Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Spread operator vs apply vs normal
Compare the differing ways you can call a function with arbitrary arguments dynamically
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Browser:
Chrome 123
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
spread
12584240.0 Ops/sec
apply
12446070.0 Ops/sec
normal
5325731.0 Ops/sec
Script Preparation code:
function test(a , b , c , d , e) { return a + b + c + d + e } var using = (new Array(5)).fill(null).map((e, i) => (i));
Tests:
spread
test(...using);
apply
test.apply(null, using)
normal
test(using[0] , using[1] , using[2] , using[3] , using[4])