handle args

Benchmark created by Paul Grenier on


Setup

function noop() {}

Test runner

Ready to run.

Testing in
TestOps/sec
a
(function () {
    Array.prototype.forEach.call(arguments, function (e, i) {
       noop(e, i);
    });
}(3, 2, 1));
ready
b
(function () {
    var args = Array.prototype.slice.call(arguments), i, len;
    for (i = 0, len = args.length; i < len; i += 1) {
       noop(args[i], i);
    }
}(3, 2, 1));
ready
c
(function () {
    var i, len;
    for (i = 0, len = arguments.length; i < len; i += 1) {
       noop(arguments[i], i);
    }
}(3, 2, 1));
ready

Revisions

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

  • Revision 1: published by Paul Grenier on