call vs apply arguments (v55)

Revision 55 of this benchmark created by call vs apply arguments on


Setup

function Obj() {
      var that = "that";
    }
    Obj.prototype.target = function(arg) {
      var string = "that: " + this.that + ", arg: " + arg;
      return string;
    };
    var that = {
      that: "that"
    };
    var arg = "arg";
    
    var doCall = function(arg1) {
      Obj.prototype.target.call(that, arg1);
    };
    
    var doApply = function() {
      Obj.prototype.target.apply(that, arguments);
    };

Test runner

Ready to run.

Testing in
TestOps/sec
Call
doCall(arg);
ready
Apply
doApply(arg);
ready
call.apply
Function.call.apply(Obj.prototype.target, that, arg_array);
ready

Revisions

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