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 (with many params)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Browser:
Chrome 135
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
direct call
213110.4 Ops/sec
bind
212830.6 Ops/sec
call
218793.2 Ops/sec
apply
217898.3 Ops/sec
method call
227886.8 Ops/sec
Script Preparation code:
function test(a, b, c, d, e, f) { console.log(this, a, b, c, d, e, f); } function test1(self, a, b, c, d, e, f) { console.log(self, a, b, c, d, e, f); } function test2(a, b, c, d, e, f) { console.log(this, a, b, c, d, e, f); } function test3(a, b, c, d, e, f) { console.log(this, a, b, c, d, e, f); } function test4(a, b, c, d, e, f) { console.log(this, a, b, c, d, e, f); } String.prototype.test5 = function(a, b, c, d, e, f) { console.log(this, a, b, c, d, e, f) }
Tests:
direct call
test1("a", "b", "c", "d", "e", "f");
bind
test2.bind("a", "b", "c", "d", "e", "f")();
call
test3.call("a", "b", "c", "d", "e", "f");
apply
test4.apply(this, ["a", "b", "c", "d", "e", "f"]);
method call
"_".test5("a", "b", "c", "d", "e", "f")