Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36
Chrome 85
Mac OS X 10.15.6
Desktop
4 years ago
Test name Executions per second
Array constructor - 10 items 5364987.5 Ops/sec
Array literal - 10 items 28669618.0 Ops/sec
Array literal (assign by index) - 10 items 28688986.0 Ops/sec
Array literal (explicit length) - 10 items 7094729.5 Ops/sec
Array constructor - 1000 items 869656.9 Ops/sec
Array literal - 1000 items 254121.5 Ops/sec
Array literal (assign by index) - 1000 items 280799.5 Ops/sec
Array literal (explicit length) - 1000 items 848051.4 Ops/sec
Array constructor - 100000 items 5090.6 Ops/sec
Array literal - 100000 items 1591.1 Ops/sec
Array literal (assign by index) - 100000 items 1679.7 Ops/sec
Array literal (explicit length) - 100000 items 5251.0 Ops/sec
Tests:
  • Array constructor - 10 items

  • Array literal - 10 items

  • Array literal (assign by index) - 10 items

  • Array literal (explicit length) - 10 items

  • Array constructor - 1000 items

  • Array literal - 1000 items

  • Array literal (assign by index) - 1000 items

  • Array literal (explicit length) - 1000 items

  • Array constructor - 100000 items

  • Array literal - 100000 items

  • Array literal (assign by index) - 100000 items

  • Array literal (explicit length) - 100000 items


;