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) SamsungBrowser/28.0 Chrome/130.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 130
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Multiple of x
54.5M/s
Max32
54.4M/s
Division
52.0M/s
Math.log2
44.1M/s
View exact numbers
Test name
Executions per second
✓
Multiple of x
54,537,336 Ops/sec
Max32
54,396,600 Ops/sec
Division
52,025,624 Ops/sec
Math.log2
44,105,648 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;