Tests:
  • Splice

    AخA
     
    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>

Previous results

Experimental features:

  • Test case name Result
    Splice
    Slice
    Concat
    Spread

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 months ago)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36
Chrome Mobile 131 on Android
View result in a separate tab
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