Single object vs multiples

JavaScript performance comparison

Test case created

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Single object
for (var i = 0; i < 1000000; i++) {
  var myOb = {
    d: 3,
    j: 5
  };
}
pending…
multiple
for (var i = 0; i < 1000000; i++) {
  var myOb = {};
  myOb.d = 3;
  myOb.j = 5;
}
pending…
allocate
for (var i = 0; i < 1000000; i++) {
  var myOb = {d:undefined,j:undefined};
  myOb.d = 3;
  myOb.j = 5;
}
pending…

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

Compare results of other browsers

0 comments

Add a comment