Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Math.log2 vs division for power of two vs multiple of x vs max32
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 138
Operating system:
Android
Device Platform:
Mobile
Date tested:
10 months ago
Test name
Executions per second
Division
57967728.0 Ops/sec
Math.log2
59132212.0 Ops/sec
Tests:
Division
return 4294967295 / 65536 >>> 0;
Math.log2
return 4294967295 >>> (32 - Math.log2(65536));
Multiple of x
const kelipatan = 65536 * (2_097_152 / 65536 >>> 0); const urutanAcak = 4294967295 >>> 11; const reject = urutanAcak >= kelipatan; return urutanAcak % 65536;
Max32
return 4294967295 * 65536 / 4294967296 >>> 0;