Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
concat vs push vs push loop
(version: 1)
Comparing performance of:
concat vs push vs push in a loop
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Tests:
concat
const largeArray = new Array(10000); let rows = new Array(100000); rows = rows.concat(largeArray);
push
const largeArray = new Array(10000); const rows = new Array(100000); rows.push(...largeArray);
push in a loop
const largeArray = new Array(10000); const rows = new Array(100000); for (const item of largeArray) { rows.push(item); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
concat
push
push in a loop
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser/OS:
Chrome 132 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
concat
1325.6 Ops/sec
push
354.8 Ops/sec
push in a loop
281.0 Ops/sec
Related benchmarks:
prepend
concat vs push
concat vs push
array concat vs push vs spread
concat vs push in javascript 2
For i / For of / ForEach
large array concat vs large array spread
spread vs concat vs unshift223
Benchmark, spread vs. concat vs. push in Array push item
Comments
Confirm delete:
Do you really want to delete benchmark?