Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Modulo VS bitwise AND for finding odd number
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Modulo
61881772.0 Ops/sec
bitwise AND
61243312.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
function getRandomArray() { const arr = []; for (let i = 0; i < 10000; i++) { Math.floor(Math.random() * 100000) + 1; } return arr; } var randomArr = getRandomArray()
Tests:
Modulo
const x = randomArr.map(x => x % 2 === 1)
bitwise AND
const y = randomArr.map(x => x & 1 === 1)