Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Linux
Desktop
11 months ago
Test name Executions per second
Array constructor - 10_000 items 46417.6 Ops/sec
Array literal - 10_000 items 24748.4 Ops/sec
Array literal (assign by index) - 10_000 items 23657.3 Ops/sec
Array literal (explicit length) - 10 items 47469.1 Ops/sec
Frozen Array constructor - 10_000 items 230.1 Ops/sec
Array constructor, no new - 10_000 items 45154.3 Ops/sec
Array constructor fill - 10_000 items 27692.2 Ops/sec
Tests:
  • Array constructor - 10_000 items

  • Array literal - 10_000 items

  • Array literal (assign by index) - 10_000 items

  • Array literal (explicit length) - 10 items

  • Frozen Array constructor - 10_000 items

  • Array constructor, no new - 10_000 items

  • Array constructor fill - 10_000 items