Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array push vs spread operators
(version: 1)
Comparing performance of:
Push vs Spread
Created:
8 months ago
by:
Guest
Go to the latest result
Tests:
Push
let first = Array.from({ length: 100 }, (_, i) => i); let second = Array.from({ length: 100 }, (_, i) => i); let all = first.push(...second)
Spread
let first = Array.from({ length: 100 }, (_, i) => i); let second = Array.from({ length: 100 }, (_, i) => i); let all = [...first, ...second]
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Push
Spread
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
8 months ago
)
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Mobile Safari/537.36 OPR/92.0.0.0
Browser/OS:
Opera Mobile 92 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Push
58K/s
Spread
57K/s
View exact numbers
Test name
Executions per second
✓
Push
58,232 Ops/sec
Spread
57,343 Ops/sec
Related benchmarks
comparing push vs spread one by one
Pushing items via Array.push vs. Spread Operator
Push vs LHS spread
Comments
Confirm delete:
Do you really want to delete benchmark?