The arguments object

Benchmark created by Mathias Bynens on


Description

How slow is the use of arguments?

Preparation HTML

<script>
  function a() {
   return [arguments[0], arguments[1], arguments[2]];
  }
  
  function b() {
   return arguments;
  }
  
  function c(arg1, arg2, arg3) {
   return [arg1, arg2, arg3];
  }
</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.