Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Spread operator vs apply 2
(version: 0)
Compare the differing ways you can call a function with arbitrary arguments dynamically
Comparing performance of:
spread vs apply
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
function test() { console.log(arguments[arguments.length - 1]); } var using = (new Array(2)).fill(null).map((e, i) => (i));
Tests:
spread
test(...using);
apply
test.apply(null, using)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
spread
apply
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
3 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Browser/OS:
Chrome 143 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
spread
225589.8 Ops/sec
apply
216523.5 Ops/sec
Related benchmarks:
Spread operator vs apply
Spread operator vs apply - jnslg
Spread operator vs apply - 2
Spread operator vs apply new
Spread operator vs apply vs apply undefined
Spread operator vs apply vs apply undefined. length 6
Spread operator vs apply - realistic
Spread operator vs apply vs normal
Comments
Confirm delete:
Do you really want to delete benchmark?