Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0
Firefox 91
Mac OS X 10.15
Desktop
3 years ago
Test name Executions per second
for of: few items 4161629.5 Ops/sec
for of: many items 29322.8 Ops/sec
convert to array: few items 2427824.8 Ops/sec
convert to array: many items 20555.7 Ops/sec
native iterator: few items 4244989.0 Ops/sec
native iterator: many items 27817.0 Ops/sec
native iterator w/ size: few items 3934826.0 Ops/sec
native iterator w/ size: many items: 27001.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: