even-odd-module-vs-bitwise (v3)

Revision 3 of this benchmark created on


Description

Module vs. Bitwise with comparison against 0

Test runner

Ready to run.

Testing in
TestOps/sec
Minus


var x = 1;
for (var i = 0; i < 10000; ++i) {  
    x = 1 - x;
    var isEven = (0 === x);
}
ready
Bitwise
for (var i = 0; i < 10000; ++i) {  
    var isEven = (0 === i & 1);
}
ready
Module
for (var i = 0; i < 10000; ++i) {  
    var isEven = (0 === i % 2);
}
ready

Revisions

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