call vs apply (v31)

Revision 31 of this benchmark created by Ajnasz on


Setup

var obj = {a:1};
    function foo() {
       return this;
    }
    function bar(o) {
       return o;
    }
    function baz() {
       return bar(this);
    }

Test runner

Ready to run.

Testing in
TestOps/sec
Call
foo.call(obj);
ready
Apply
foo.apply(obj);
ready
native
bar(obj)
ready
Call to other
baz(obj)
ready

Revisions

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