Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
js arr funcs
(version: 2)
Comparing performance of:
spread vs concat vs push.apply
Created:
one year ago
by:
Registered User
Jump to the latest result
Tests:
spread
const arr1 = Array(100000).fill(Math.random()) const arr2 = Array(100000).fill(Math.random()) arr1.push(...arr2)
concat
const arr1 = Array(100000).fill(Math.random()) const arr2 = Array(100000).fill(Math.random()) let res = arr1.concat(arr2)
push.apply
const arr1 = Array(100000).fill(Math.random()) const arr2 = Array(100000).fill(Math.random()) Array.prototype.push.apply(arr1, arr2)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
spread
concat
push.apply
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Browser/OS:
Chrome 129 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
spread
125.1 Ops/sec
concat
287.7 Ops/sec
push.apply
130.0 Ops/sec
Related benchmarks:
test444
concat vs spread 2
Test perfomance
Spread vs concat vs forEach array v1001
concat 1 vs multiple
merging two 10k items array comparison
Includes VS new Set
Comments
Confirm delete:
Do you really want to delete benchmark?