call vs apply (v65)

Revision 65 of this benchmark created on


Setup

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

Test runner

Ready to run.

Testing in
TestOps/sec
Call
var that = {that: "that"};
Obj.prototype.target.call(that);
ready
Apply
var that = {that: "that"};
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.