Performance of Array vs. Object (v25)

Revision 25 of this benchmark created on


Setup

var arr = [9, 9],
      obj = {
      one: 9,
      two: 9
      },
      one = 9,
      two = 9;

Test runner

Ready to run.

Testing in
TestOps/sec
Array Performance (1)
var sum = arr[0] + arr[1];
ready
Array Performance (2)
var x = arr[0];
var y = arr[1];
var sum = x + y;
ready
Object Performance (1)
var sum = obj.one + obj.two;
ready
Object performance (2)
var x = obj.one;
var y = obj.two;
var sum = x + y;
ready
Variable performance
var sum = one + two;
ready
Primitive performance
var sum = 9 + 9;
ready

Revisions

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