Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36
Yandex Browser 24
Linux
Desktop
9 months ago
Test name Executions per second
for of: few items 10195990.0 Ops/sec
for of: many items 272006.2 Ops/sec
convert to array: few items 3778406.5 Ops/sec
convert to array: many items 164206.8 Ops/sec
native iterator: few items 8370448.0 Ops/sec
native iterator: many items 239144.6 Ops/sec
native iterator w/ size: few items 5523483.5 Ops/sec
native iterator w/ size: many items: 209282.2 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: