Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Direct call vs bind vs call vs apply vs self
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 123
Operating system:
Android
Device Platform:
Mobile
Date tested:
2 years ago
Test name
Executions per second
direct call
59492.9 Ops/sec
bind
50422.3 Ops/sec
call
57756.8 Ops/sec
apply
62238.2 Ops/sec
method call
58294.7 Ops/sec
Script Preparation code:
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")