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: 12 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Chrome 133 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
direct call 222831.0 Ops/sec
bind 227481.4 Ops/sec
call 225925.9 Ops/sec
apply 223383.6 Ops/sec
method call 213645.9 Ops/sec