Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
calcTriangleCount vs calcSegments
(version: 1)
calcTriangleCount vs calcSegments
Comparing performance of:
calcTriangleCount vs calcSegments
Created:
one year ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
calcTriangleCount vs calcSegments
Script Preparation code:
var N = 1000000; var x = new Float32Array(N); var y = new Float32Array(N); var z = new Float32Array(N); for (var i = 0; i < N; ++i) { x[i] = 100 * Math.random(); y[i] = Math.random(); z[i] = Math.random(); } function calcTriangleCount(r, tolerance, zoom) { return Math.PI / Math.acos(1 - (tolerance * zoom) / r); } function calcSegments(r, tolerance, scale) { return 2 * Math.sqrt((2 * (r * scale)) / tolerance); }
Tests:
calcTriangleCount
for (var i = 0; i < N; ++i) { calcTriangleCount(x[i], z[i], y[i]); }
calcSegments
for (var i = 0; i < N; ++i) { calcSegments(x[i], z[i], y[i]); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
calcTriangleCount
calcSegments
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser/OS:
Chrome 132 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
calcTriangleCount
316.4 Ops/sec
calcSegments
315.0 Ops/sec
Related benchmarks:
Haversine
Haversine
trigata
acos vs atan
reduce vs for loop vs for..of loop vs forEach 1000 count
acos vs atan2
atan2 vs acos
soa vs aos vs typed soa 3
fast sin cos vs math sin cos
Comments
Confirm delete:
Do you really want to delete benchmark?