Tests:
  • spread

    x
     
    // Used to popolate the arrays to merge with 10.000.000 elements.
    let array1 = [];
    let array2 = [];
    for (let i = 0; i < 10000000; ++i) {
        array1.push(i);
        array2.push(i);
    }
    const array3 = [ ...array1, ...array2 ];
  • concat

     
    // Used to popolate the arrays to merge with 10.000.000 elements.
    let array1 = [];
    let array2 = [];
    for (let i = 0; i < 10000000; ++i) {
        array1.push(i);
        array2.push(i);
    }
    // The concat performance test.
    const array3 = array1.concat(array2);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    spread
    concat

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36
Chrome 81 on Mac OS X 10.15.3
View result in a separate tab
Test name Executions per second
spread 2.7 Ops/sec
concat 2.8 Ops/sec