Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
personal spread array performance (vs slice, splice, concat)
(version: 0)
Benchmark.js
Comparing performance of:
Splice vs Slice vs Concat vs Spread
Created:
5 years ago
by:
Guest
Go 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
Spread
5K/s
Splice
3K/s
Slice
3K/s
Concat
3K/s
View exact numbers
Test name
Executions per second
✓
Spread
5,111 Ops/sec
Splice
3,445 Ops/sec
Slice
3,381 Ops/sec
Concat
3,288 Ops/sec
Related benchmarks
Slice & Splice vs ES6 Array Spread
Concat vs Spread for Large Arrayss
Comments
Confirm delete:
Do you really want to delete benchmark?