Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Math.log2 vs division for power of two vs multiple of x vs max32
(version: 5)
Comparing performance of:
Division vs Math.log2 vs Multiple of x vs Max32
Created:
10 months ago
by:
Registered User
Jump to the latest result
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;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
Division
Math.log2
Multiple of x
Max32
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
10 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser/OS:
Chrome 137 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Division
131133872.0 Ops/sec
Math.log2
123082872.0 Ops/sec
Multiple of x
113615768.0 Ops/sec
Max32
132389760.0 Ops/sec
Related benchmarks:
asdfasdffdas
!!a && b or a && b
test pef
Math.pow vs ** vs * version 2
Math min
Exponentiation vs Math.pow test
Absolute value using Math.abs vs ternary and * -1
Inverse + Multiply vs Divide
operand size
Comments
Confirm delete:
Do you really want to delete benchmark?