swap array vs variable (v23)

Revision 23 of this benchmark created by kayakyakr on


Description

testing complex variables

Setup

var a = {a: 1, b: 1},
        b = {a: 2, b: 2};

Test runner

Ready to run.

Testing in
TestOps/sec
array
b = [a, a = b][0];
ready
variable
var c = a;
a = b;
b = c;
ready
bit
// bit only works with integers
a = 1;
b = 2;

a = a ^ b;
b = a ^ b;
a = a ^ b;
ready

Revisions

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