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 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0
Browser:
Firefox 145
Operating system:
Windows
Device Platform:
Desktop
Date tested:
5 months ago
Test name
Executions per second
Modulo
119274240.0 Ops/sec
bitwise AND
120793960.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)