Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array spread vs. push performance
(version: 0)
Comparing performance of:
Array.prototype.push vs Array.prototype.concat vs Array spread
Created:
7 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arr = [1, 1, 1, 1, 1];
Tests:
Array.prototype.push
arr.push(1);
Array.prototype.concat
arr.concat(1);
Array spread
[...arr, 1];
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Array.prototype.push
Array.prototype.concat
Array spread
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:145.0) Gecko/20100101 Firefox/145.0
Browser/OS:
Firefox 145 on Ubuntu
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array.prototype.push
22842736.0 Ops/sec
Array.prototype.concat
1.6 Ops/sec
Array spread
0.1 Ops/sec
Related benchmarks:
Arrays: spread operator vs push
Array: spread operator vs push
Array clone from index 1 to end: spread operator vs slice
Push vs Spread JavaScript
Comments
Confirm delete:
Do you really want to delete benchmark?