boolean-cast

Benchmark created by WebReflection on


Description

just because some minifier changes true and false into !0 and !1, I'd like to test how this cn affect loops performances

Test runner

Ready to run.

Testing in
TestOps/sec
no cast
for (var i = 1, result; i < 0xFFFF; ++i) {
    result = [
        true,
        false,
        true,
        false,
        false,
        true,
        true,
        false
    ];
}
ready
cast
for (var i = 1, result; i < 0xFFFF; ++i) {
    result = [
        !0,
        !1,
        !0,
        !1,
        !1,
        !0,
        !0,
        !1
    ];
}
ready

Revisions

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

  • Revision 1: published by WebReflection on