Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Largest multiple of number less than a uniform source size
(version: 1)
Comparing performance of:
modulo vs division, unsigned right shift
Created:
10 months ago
by:
Registered User
Jump to the latest result
Script Preparation code:
const FULL = 2_097_152; const bound = 12818;
Tests:
modulo
return FULL - (FULL % bound);
division, unsigned right shift
return bound * (FULL / bound >>> 0);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
modulo
division, unsigned right shift
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
10 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Browser/OS:
Chrome 138 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
modulo
107212720.0 Ops/sec
division, unsigned right shift
119060968.0 Ops/sec
Related benchmarks:
Is odd
If/Else vs Ternary
Parse 32-bit hex | BigInt vs regex + parseInt
Is odd (large)
Is odd (large float)
arithm vs ternary
Function vs () =>
Right bit shift vs divide by 2
operand size
Comments
Confirm delete:
Do you really want to delete benchmark?