Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
distance calculations
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 26
Operating system:
iOS 18.7
Device Platform:
Mobile
Date tested:
21 days ago
Test name
Executions per second
hypot
154.4 Ops/sec
sqrt
3216.6 Ops/sec
sqrt + pow
3149.9 Ops/sec
i*i
2407.2 Ops/sec
pow
2598.5 Ops/sec
Script Preparation code:
function testHypot() { for (let i=0; i < 1000; i++){ for (let j=0; j < 1000; j++) { Math.hypot(i, j) } } } function testSqrt() { for (let i=0; i < 1000; i++){ for (let j=0; j < 1000; j++) { Math.sqrt(i*i+j*j) } } } function testSqrtAndPow() { for (let i=0; i < 1000; i++){ for (let j=0; j < 1000; j++) { Math.sqrt(Math.pow(i,2)+Math.pow(j,2)) } } } function testNoSqrt() { for (let i=0; i < 1000; i++){ for (let j=0; j < 1000; j++) { i*i+j*j } } } function testNoSqrtAndPow() { for (let i=0; i < 1000; i++){ for (let j=0; j < 1000; j++) { Math.pow(i,2)+Math.pow(j,2) } } }
Tests:
hypot
testHypot()
sqrt
testSqrt()
sqrt + pow
testSqrtAndPow()
i*i
testNoSqrt()
pow
testNoSqrtAndPow()