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
Go 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
concat
1K/s
push
355/s
push in a loop
281/s
View exact numbers
Test name
Executions per second
✓
concat
1,326 Ops/sec
push
355 Ops/sec
push in a loop
281 Ops/sec
Comments
Confirm delete:
Do you really want to delete benchmark?