Script Preparation code:
Tests:

Historical Performance Data aggregated from 8 community runs

Desktop Results:
Chrome 8 runs
Direct assign an item to an initialized array
112K/s
items[items.length] outer length counter + new Array()
110K/s
items[items.length] outer length counter
76K/s
items[items.length]
72K/s
Push item to an array
50K/s
Append an item by spread
625/s

Fastest: Direct assign an item to an initialized array (179.8x faster)

View exact numbers
  • Direct assign an item to an initialized array: 112,368 ops/sec
  • items[items.length] outer length counter + new Array(): 109,864 ops/sec
  • items[items.length] outer length counter: 75,746 ops/sec
  • items[items.length]: 72,292 ops/sec
  • Push item to an array: 50,079 ops/sec
  • Append an item by spread: 625 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Push item to an array
    Append an item by spread
    Direct assign an item to an initialized array
    items[items.length]
    items[items.length] outer length counter
    items[items.length] outer length counter + new Array()
    Cutting empty tail

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3424.0 Safari/537.36
Chrome 68 on Linux
View result in a separate tab
Direct assign an item to an initialized array
74K/s
items[items.length] outer length counter + new Array()
71K/s
Cutting empty tail
64K/s
items[items.length]
45K/s
items[items.length] outer length counter
45K/s
Push item to an array
36K/s
Append an item by spread
66/s
View exact numbers
Test name Executions per second
Direct assign an item to an initialized array 74,115 Ops/sec
items[items.length] outer length counter + new Array() 71,488 Ops/sec
Cutting empty tail 64,241 Ops/sec
items[items.length] 44,867 Ops/sec
items[items.length] outer length counter 44,741 Ops/sec
Push item to an array 36,145 Ops/sec
Append an item by spread 66 Ops/sec