Function parameters vs Arguments object

JavaScript performance comparison

Test case created by Pencroff

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  argFunc = function () {
  this.a = arguments[0];
  this.b = arguments[1];
  this.c = arguments[2];
  },
  paramFunc = function (aParam, bParam, cParam) {
  this.a = aParam;
  this.b = bParam;
  this.c = cParam;
  }
  

};
</script>

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 object
new argFunc ('ParamA', 77, true);
pending…
Function parameters
new paramFunc('ParamA', 77, true);
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