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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Browser:
Chrome 138
Operating system:
Linux
Device Platform:
Desktop
Date tested:
10 months ago
Test name
Executions per second
Division
121599072.0 Ops/sec
Math.log2
123435280.0 Ops/sec
Multiple of x
120920584.0 Ops/sec
Max32
117543896.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;