Arguments vs. Undefined Check

JavaScript performance comparison

Revision 11 of this test case created


Checks to see if it is worthwhile avoiding arguments.

Preparation code

Benchmark.prototype.setup = function() {
    function testMethod(a, b, c) {
      return a + b + c;
    function variadicBind(method) {
      var context = this;
      return function() {
        return method.apply(context, arguments);
    function restrictBind(method) {
      var context = this;
      return function(a, b, c, d, e) {
        return, a, b, c, d, e);

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
variadic BIND

var variadicBound = variadicBind(testMethod);
restrict BIND
var restrictBound = restrictBind(testMethod);

Compare results of other browsers


You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:


Comment form temporarily disabled.

Add a comment