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
Test name
Executions per second
direct call
403114144.0 Ops/sec
bind
58908872.0 Ops/sec
call
29018966.0 Ops/sec
apply
132318536.0 Ops/sec
apply arguments
136577264.0 Ops/sec
call arguments
13246219.0 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);