call vs apply no args (v6)

Revision 6 of this benchmark created by gsf on


Setup

function Obj() {
      var that = "that";
    }
    Obj.prototype.target = function() {
      var string = "that: " + this.that;
      return string;
    };
    
    var myObj = new Obj(),
        that = {that: "that"};

Test runner

Ready to run.

Testing in
TestOps/sec
Call
Obj.prototype.target.call(that);
ready
Apply
Obj.prototype.target.apply(that);
ready
Normal invocation
new Obj().target();
ready
Normal invocation cached Obj
myObj.target();
ready

Revisions

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