Arguments vs. Undefined Check

JavaScript performance comparison

Revision 8 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);
    var variadicBound = variadicBind(testMethod);
    var restrictBound = restrictBind(testMethod);

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
variadicBound(1, 2, 3);
Undefined Check
restrictBound(1, 2, 3);

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:


Add a comment