Script Preparation code:
AخA
 
var array1 = Array(400).fill().map(() => Math.round(Math.random() * 40));
var array2 = Array(400).fill().map(() => Math.round(Math.random() * 40));
var array3 = Array(400).fill().map(() => Math.round(Math.random() * 40));
var array4 = Array(400).fill().map(() => Math.round(Math.random() * 40));
var array5 = Array(400).fill().map(() => Math.round(Math.random() * 40));
Tests:
  • Array.concat

     
    var others = array1.concat(array2, array3, array4, array5);
  • Array.prototype.concat.apply

     
    var others = Array.prototype.concat.apply([], [array1, array2, array3, array4, array5]);
  • Array.prototype.concat.apply short form

     
    var others = [].concat.apply([], [array1, array2, array3, array4, array5]);
  • Array.prototype.concat.apply short form without new empty array instance in apply

     
    var others = [].concat.apply(array1, [array2, array3, array4, array5]);
  • Array.prototype.concat.apply short form without new empty array at all

     
    var others = array1.concat.apply(array1, [array2, array3, array4, array5]);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array.concat
    Array.prototype.concat.apply
    Array.prototype.concat.apply short form
    Array.prototype.concat.apply short form without new empty array instance in apply
    Array.prototype.concat.apply short form without new empty array at all

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 days ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0
Firefox 138 on Mac OS X 10.15
View result in a separate tab
Test name Executions per second
Array.concat 633760.1 Ops/sec
Array.prototype.concat.apply 722029.6 Ops/sec
Array.prototype.concat.apply short form 716586.6 Ops/sec
Array.prototype.concat.apply short form without new empty array instance in apply 692072.8 Ops/sec
Array.prototype.concat.apply short form without new empty array at all 695576.4 Ops/sec