Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114
Windows
Desktop
one year ago
Test name Executions per second
for of: few items 11137215.0 Ops/sec
for of: many items 369851.9 Ops/sec
convert to array: few items 3807426.2 Ops/sec
convert to array: many items 223833.9 Ops/sec
native iterator: few items 10637821.0 Ops/sec
native iterator: many items 350884.5 Ops/sec
native iterator w/ size: few items 5584788.5 Ops/sec
native iterator w/ size: many items: 344416.9 Ops/sec
Script Preparation code:
Tests:
  • for of: few items

  • for of: many items

  • convert to array: few items

  • convert to array: many items

  • native iterator: few items

  • native iterator: many items

  • native iterator w/ size: few items

  • native iterator w/ size: many items: