Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JS sqrt operator comparison
(version: 1)
Comparing performance of:
sqrt with Math.sqrt vs sqrt with Math.pow vs sqrt with **
Created:
10 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var numbers = Array.from(Array(10000), (_,x) => (Math.random()*x));
Tests:
sqrt with Math.sqrt
numbers.forEach(x => Math.sqrt(x));
sqrt with Math.pow
numbers.forEach(x => Math.pow(x,0.5));
sqrt with **
numbers.forEach(x => x ** 0.5);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
sqrt with Math.sqrt
sqrt with Math.pow
sqrt with **
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
7 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0
Browser/OS:
Chrome 140 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
sqrt with Math.sqrt
349482.7 Ops/sec
sqrt with Math.pow
188244.5 Ops/sec
sqrt with **
188615.4 Ops/sec
Related benchmarks:
x**0.5 vs Math.pow(x,0.5) vs Math.sqrt(x)
Math.pow(x,0.5) vs Math.sqrt(x) vs x**
Math.pow(x,0.5) vs Math.sqrt(x) vs **
(x ** 0.5) vs Math.sqrt(x)
Math.pow(x,0.5) vs Math.sqrt(x) vs x**0.5
Math.pow(x,0.5) vs Math.sqrt(x) vs **.5
Math.pow(x,0.5) vs Math.sqrt(x) vs ** 0.5
Math.pow(x,0.5) vs Math.sqrt(x) vs (x ** 0.5)
x ** 0.5 vs Math.sqrt(x)
Comments
Confirm delete:
Do you really want to delete benchmark?