Arguments De-Opt

JavaScript performance comparison

Test case created by Malte Ubl

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
arguments appears
function test() {
  arguments;
  var sum = 0;
  for(var i = 0; i < 10000; i++) {
    for(var n = 0; n < 1000; n++) {
      sum += n;
    }
  }
}
test();
pending…
Convert to array
function test() {
  var a = Array.prototype.slice.call(arguments);
  var sum = 0;
  for(var i = 0; i < 10000; i++) {
    for(var n = 0; n < 1000; n++) {
      sum += n;
    }
  }
}
test();
pending…
Indexed access
function test() {
  var a = arguments[0];
  var sum = 0;
  for(var i = 0; i < 10000; i++) {
    for(var n = 0; n < 1000; n++) {
      sum += n;
    }
  }
}
test();
pending…
access to callee
function test() {
  var fn = arguments.callee;
  var sum = 0;
  for(var i = 0; i < 10000; i++) {
    for(var n = 0; n < 1000; n++) {
      sum += n;
    }
  }
}
test();
pending…
access to length
function test() {
  var num = arguments.length;
  var sum = 0;
  for(var i = 0; i < 10000; i++) {
    for(var n = 0; n < 1000; n++) {
      sum += n;
    }
  }
}
test();
pending…
No arguments (reference)
function test() {
  var sum = 0;
  for(var i = 0; i < 10000; i++) {
    for(var n = 0; n < 1000; n++) {
      sum += n;
    }
  }
}
test();
pending…
eval is here (reference)
function test() {
  eval('');
  var sum = 0;
  for(var i = 0; i < 10000; i++) {
    for(var n = 0; n < 1000; n++) {
      sum += n;
    }
  }
}
test();
pending…

Compare results of other browsers

Revisions

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

0 Comments