Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Chrome 124
Linux
Desktop
8 months ago
Test name Executions per second
for of: few items 9588337.0 Ops/sec
for of: many items 288467.7 Ops/sec
convert to array: few items 3332301.8 Ops/sec
convert to array: many items 191018.8 Ops/sec
native iterator: few items 10000623.0 Ops/sec
native iterator: many items 257052.8 Ops/sec
native iterator w/ size: few items 5796883.5 Ops/sec
native iterator w/ size: many items: 242879.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: