Script Preparation code:
x
 
function wrapExplicit(fn) {
  return function(a1, a2, a3) {
    return fn.call(this, this, a1, a2, a3)
  }
}
function wrapApply(fn) {
  return function() {
    var args = [this]
    for (let i = 0, len = arguments.length; i < len; i++) {
      args[i + 1] = arguments[i]
    }
    return fn.apply(this, args)
  }
}
function wrapApplyWithArguments(fn) {
  return function() {
    return fn.apply(this, [this].concat(arguments))
  }
}
function fn(thisArg, a1, a2, a3) {
  thisArg.result = a1 + a2 + a3
}
var explicitCall = { fn: wrapExplicit(fn) }
var applyCall = { fn: wrapApply(fn) }
var applyWithArgumentsCall = { fn: wrapApplyWithArguments(fn) }
Tests:
  • Explicit call

     
    explicitCall.fn(Math.random(), Math.random(), Math.random())
  • Apply call

     
    applyCall.fn(Math.random(), Math.random(), Math.random())
  • Apply with arguments call

     
    applyWithArgumentsCall.fn(Math.random(), Math.random(), Math.random())
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Explicit call
    Apply call
    Apply with arguments call

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Chrome 52 on Mac OS X 10.11.6
View result in a separate tab
Test name Executions per second
Explicit call 971056.4 Ops/sec
Apply call 856130.4 Ops/sec
Apply with arguments call 367501.2 Ops/sec