arguments hit performance (v9)

Revision 9 of this benchmark created by Abdullah Aydın on


Setup

var res = [];
  var args = new Array(100).fill( new Array(1000).join('#') );
  
  function f1(a, b, c){
      res = [a, b, c];
  }
  function f2(){
      res = [arguments[0], arguments[1], arguments[2]];
  }
  
  function d1(Arguments){
      res = Arguments.slice(0, 3);
  }
  function dd2(Arguments){
      res = Array.prototype.slice.call(Arguments, 0, 3);
  }
  function dd3(){
      res = Array.prototype.slice.call(arguments, 0, 3);
  }
  
  function len1(Arguments){
      res = Arguments.length;
  }
  function len2(){
      res = arguments.length;
  }

Teardown



            res = [];
  args = new Array(100).fill( new Array(1000).join('#') );
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
F series #1
f1.apply(null, args);
ready
F series #2
f2.apply(null, args);
ready
D series #1
d1(args);
ready
D series #2
dd2(args);
ready
D series #3
dd3.apply(null, args);
ready
LEN series #1
len1(args);
ready
LEN series #2
len2.apply(null, args);
ready

Revisions

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