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:
one year ago
Multiple of x
60.7M/s
Division
59.7M/s
Math.log2
59.4M/s
View exact numbers
Test name
Executions per second
✓
Multiple of x
60,666,580 Ops/sec
Division
59,657,792 Ops/sec
Math.log2
59,356,880 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;