Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15
Safari 14
Mac OS X 10.15.7
Desktop
4 years ago
Test name Executions per second
for of: few items 5240650.0 Ops/sec
for of: many items 207994.8 Ops/sec
convert to array: few items 1152419.6 Ops/sec
convert to array: many items 22359.6 Ops/sec
native iterator: few items 6034644.0 Ops/sec
native iterator: many items 107820.7 Ops/sec
native iterator w/ size: few items 5118488.5 Ops/sec
native iterator w/ size: many items: 424769.1 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: