Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
call spread vs apply
(version: 1)
Comparing performance of:
spread vs apply
Created:
one year ago
by:
Guest
Go to the latest result
Script Preparation code:
let arr = Array.from({length:500},(a,index)=>index) function average(...numbers){return numbers.reduce((a,b)=>a+b)/numbers.length}
Tests:
spread
for (let i = 3000; --i;) var result = average.call(null,...arr)
apply
for (let i = 3000; --i;) var result = average.apply(null,arr)
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:
10 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:142.0) Gecko/20100101 Firefox/142.0
Browser/OS:
Firefox 142 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
apply
95/s
spread
20/s
View exact numbers
Test name
Executions per second
✓
apply
95 Ops/sec
spread
20 Ops/sec
Related benchmarks
Arguments as array: spread vs apply
Spread vs mutating
Math.max with apply vs spread vs reduce 10k elements
Math.min.apply vs Spread
Math.max() without spread vs reduce vs apply
Comments
Confirm delete:
Do you really want to delete benchmark?