Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array push vs concat vs push + flat
(version: 0)
Comparing performance of:
Array.prototype.concat vs push + flat vs Push
Created:
5 years ago
by:
Guest
Jump to the latest result
Tests:
Array.prototype.concat
const params = [ "hello", true, 7 ]; const other = [ 1, 2 ].concat(params);
push + flat
const items = []; const params = [ "hello", true, 7 ] items.push(params) const other = items.flat()
Push
const params = [ "hello", true, 7 ]; const other = [ 1, 2 ].push(...params);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Array.prototype.concat
push + flat
Push
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
10 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Browser/OS:
Chrome 138 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array.prototype.concat
11152360.0 Ops/sec
push + flat
6111082.0 Ops/sec
Push
62650880.0 Ops/sec
Related benchmarks:
Array spread vs. push performance
Array push vs spread vs concat
Array construct vs array push vs array concat
Array#concat vs Array#push
array spread operator vs concat vs push fix
Comments
Confirm delete:
Do you really want to delete benchmark?