Run details:
Mozilla/5.0 (Android 10; Mobile; rv:87.0) Gecko/87.0 Firefox/87.0
Firefox Mobile 87
Android
Mobile
4 years ago
Test name Executions per second
Math.sqrt 3399.4 Ops/sec
sqrt with Math.pow 3160.1 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));