Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Direct call vs bind vs call vs apply spred
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.6.1 Safari/605.1.15
Browser:
Safari 17
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
direct call
403.1M/s
apply arguments
136.6M/s
apply
132.3M/s
bind
58.9M/s
call
29.0M/s
call arguments
13.2M/s
View exact numbers
Test name
Executions per second
✓
direct call
403,114,144 Ops/sec
apply arguments
136,577,264 Ops/sec
apply
132,318,536 Ops/sec
bind
58,908,872 Ops/sec
call
29,018,966 Ops/sec
call arguments
13,246,219 Ops/sec
Script Preparation code:
let v = -1; function test(a, b, c) { v = a + b + c; } setInterval(() => {console.log({ v }); v=-1;}, 5000)
Tests:
direct call
const fn1 = test; fn1(1, 2, 3);
bind
const fn2 = test.bind(this) fn2(2, 3, 4);
call
const fn3 = function (...args) { test.call(this, ...args); }; fn3(3, 4, 5);
apply
const fn4 = function (...args) { test.apply(this, args); }; fn4(4,5,6);
apply arguments
const fn5 = function () { test.apply(this, arguments); }; fn5(7,8,9);
call arguments
const fn3 = function () { test.call(this, ...arguments); }; fn3(10,11,11);