function calls: direct vs apply vs call vs bind (v52)

Revision 52 of this benchmark created on


Setup

function f() {
        return this;
    }
    var that = {
        f: f
    };
    var bound = f.bind(that);
    var that2 = Object.create(that);
    var that3 = {};
    var that4 = Object.create(that3);
    var that5 = (f())();

Test runner

Ready to run.

Testing in
TestOps/sec
direct
that.f();
ready
apply
f.apply(that);
ready
call
f.call(that);
ready
bind
bound();
ready
prototype
that2.f();
ready
direct (dynamic property)
that3.f = f; that3.f();
ready
prototype (dynamic property)
that3.f = f; that4.f();
ready
blank
that5
ready

Revisions

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