The arguments object (v2)

Revision 2 of this benchmark created on


Description

How slow is the use of arguments?

Preparation HTML

<script>
  function a() {
   return [arguments[0], arguments[1], arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8],arguments[9]];
  }
  
  function b() {
   return arguments;
  }
  
  function c(arg1, arg2, arg3,arg4,arg5,arg6,arg7,arg8,arg9) {
   return [arg1, arg2, arg3,arg4,arg5,arg6,arg7,arg8,arg9];
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
arguments object, accessing individual args
a('foo', 'bar', 42);
ready
arguments object
b('foo', 'bar', 42);
ready
Regular arguments
c('foo', 'bar', 42);
ready

Revisions

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