Modulus vs bitwise AND operator

Benchmark created by Miguel Mota on


Setup

var x = 10;

Test runner

Ready to run.

Testing in
TestOps/sec
Modulus
(x % 2) === 0;
ready
bitwise AND
(x & 1) === 0;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by Miguel Mota on