Function versus Function.call versus Function.apply (v2)

Revision 2 of this benchmark created on


Setup

var o = {
        f: function f(a, b, c) {
            return [a, b, c];
        }
    }, d = "string", e = 123, f = ['a', 'r', 'r', 'a', 'y'], z = [d, e, f];

Test runner

Ready to run.

Testing in
TestOps/sec
Direct
o.f(d, e, f)
ready
Call
o.f.call(o, d, e, f)
ready
Apply
o.f.apply(o, [d, e, f])
ready
Apply predefined array
o.f.apply(o, z)
ready

Revisions

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