Run details:
Mozilla/5.0 (Linux; Android 14; SM-S9110 Build/UP1A.231005.007) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.6834.163 Mobile Safari/537.36
Chrome Mobile 132
Android
Mobile
3 months ago
Test name Executions per second
Math.sqrt 48566.1 Ops/sec
sqrt with Math.pow 57985.6 Ops/sec
Script Preparation code:
AخA
 
var numbers = Array.from(Array(10000), (_,x) => (Math.random()*x));
Tests:
  • Math.sqrt

     
    numbers.forEach(x => Math.sqrt(x));
  • sqrt with Math.pow

     
    numbers.forEach(x => Math.pow(x,0.5));