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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.15
Browser:
Safari 17
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
direct call
681K/s
method call
673K/s
apply
632K/s
call
629K/s
bind
614K/s
View exact numbers
Test name
Executions per second
✓
direct call
680,811 Ops/sec
method call
673,460 Ops/sec
apply
631,631 Ops/sec
call
629,389 Ops/sec
bind
613,978 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")