Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36
Chrome 86
Mac OS X 10.15.7
Desktop
4 years ago
Test name Executions per second
for of arr: few items 13593429.0 Ops/sec
for of set: few items 12678742.0 Ops/sec
native loop arr: few items 3839012.2 Ops/sec
native iter set: few items 12448250.0 Ops/sec
for of arr: many items 575595.5 Ops/sec
for of set: many items 375794.2 Ops/sec
native loop arr: many items 15863.8 Ops/sec
native iter set: many items 324918.5 Ops/sec
Script Preparation code:
Tests:
  • for of arr: few items

  • for of set: few items

  • native loop arr: few items

  • native iter set: few items

  • for of arr: many items

  • for of set: many items

  • native loop arr: many items

  • native iter set: many items