Script Preparation code:
Tests:
  • 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

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
Test name Executions per second
Push item to an array 36145.0 Ops/sec
Append an item by spread 65.9 Ops/sec
Direct assign an item to an initialized array 74115.5 Ops/sec
items[items.length] 44867.3 Ops/sec
items[items.length] outer length counter 44740.8 Ops/sec
items[items.length] outer length counter + new Array() 71488.5 Ops/sec
Cutting empty tail 64240.8 Ops/sec