Tests:
  • Array.fill

    AخA
     
    new Array(200000).fill({ a: 1}).map(function(value, index) { return {...value, id: index}})
  • Array.from

     
    Array.from({length: 200000}, function(_v, index) { return { a: 1, id: index}})
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Array.fill
    Array.from

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Chrome 117 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Array.fill 116.8 Ops/sec
Array.from 139.2 Ops/sec