Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
personal spread array performance (vs slice, splice, concat)
(version: 0)
Comparing performance of:
Splice vs Slice vs Concat vs Spread
Created:
4 years ago
by:
Guest
Jump to the latest result
Tests:
Splice
const testArray = Array(20000).fill().map((_, idx) => idx); const newTestArray = testArray.splice(0);
Slice
const testArray = Array(20000).fill().map((_, idx) => idx); const newTestArray = testArray.slice();
Concat
const testArray = Array(20000).fill().map((_, idx) => idx); const newTestArray = testArray.concat();
Spread
const testArray = Array(20000).fill().map((_, idx) => idx); const newTestArray = [...testArray];
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
Splice
Slice
Concat
Spread
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36
Browser/OS:
Chrome Mobile 131 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Splice
3444.7 Ops/sec
Slice
3380.9 Ops/sec
Concat
3287.6 Ops/sec
Spread
5110.8 Ops/sec
Related benchmarks:
Slice & Splice vs ES6 Array Spread
Splice+Spread vs concat to concat arrays
unshift vs spread vs concat
Concat vs Spread for Large Arrayss
Splice vs Spread vs Unshift vs Concat to insert at beginning of array (fixed from slice)
Comments
Confirm delete:
Do you really want to delete benchmark?