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:
one year ago
by:
Registered User
Go 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:
one year 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
division, unsigned right shift
119.1M/s
modulo
107.2M/s
View exact numbers
Test name
Executions per second
✓
division, unsigned right shift
119,060,968 Ops/sec
modulo
107,212,720 Ops/sec
Related benchmarks
Is odd
Function vs () =>
Right bit shift vs divide by 2
operand size
Comments
Confirm delete:
Do you really want to delete benchmark?