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 arr: few items 8973197.0 Ops/sec
for of set: few items 7806309.0 Ops/sec
native loop arr: few items 2755421.5 Ops/sec
native iter set: few items 7684939.5 Ops/sec
for of arr: many items 328325.1 Ops/sec
for of set: many items 272566.0 Ops/sec
native loop arr: many items 10764.7 Ops/sec
native iter set: many items 114056.3 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