Array of array tuples vs array of objects (v2)

Revision 2 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Array of tuples
var a = [];

for (var i = 1e4; i--;) {
  a.push(['apples', 'bananas']);
}

var b
for (var i = 1e4; i--;) {
  b = a[i][0] + a[i][1]
}
ready
Array of objects
var a = [];

for (var i = 1e4; i--;) {
  a.push({
    a: 'apples',
    b: 'bananas'
  });
}

var b
for (var i = 1e4; i--;) {
  b = a[i].a + a[i].b
}
ready

Revisions

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