Performance of Array vs. Object (v14)

Revision 14 of this benchmark created by vincent piel on


Setup

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

Test runner

Ready to run.

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

Revisions

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