binSwapVars (v21)

Revision 21 of this benchmark created on


Setup

var a = ~~(Math.random()*100000);
    var b = ~~(Math.random()*100000);

Test runner

Ready to run.

Testing in
TestOps/sec
binary
a^=b; b^=a; a^=b;
ready
temp variable
var c = a;
a = b;
b = c;
ready
binary all-in-one
a = (b ^= a ^= b) ^ a;
ready

Revisions

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