Script Preparation code:
AخA
 
function test(msg) {
  //console.log(this, msg);
}
function test1(self, msg) {
  //console.log(self, msg);
}
function test2(msg) {
  //console.log(this, msg);
}
function test3(msg) {
  //console.log(this, msg);
}
function test4(msg) {
  //console.log(this, msg);
}
String.prototype.test5 = function(msg) {
  //console.log(this, msg)
}
Tests:
  • direct call

     
    test1("World", "Hello");
  • bind

     
    test2.bind("World", "Hello")();
  • call

     
    test3.call("World", "Hello");
  • apply

     
    test4.apply("World", ["Hello"]);
  • method call

     
    "World".test5("Hello")
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    direct call
    bind
    call
    apply
    method call

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
Chrome 85 on Mac OS X 10.13.6
View result in a separate tab
Test name Executions per second
direct call 12885965.0 Ops/sec
bind 10496329.0 Ops/sec
call 10522191.0 Ops/sec
apply 9681875.0 Ops/sec
method call 909749184.0 Ops/sec