Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0) Gecko/20100101 Firefox/92.0
Firefox 92
Mac OS X 10.15
Desktop
3 years ago
Test name Executions per second
Map 67.0 Ops/sec
For Loop 75.1 Ops/sec
foreach 160.8 Ops/sec
pre-allocated for loop 77.7 Ops/sec
pre-allocated unrolled for loop 76.7 Ops/sec
++for loop 75.4 Ops/sec
--for loop 8.3 Ops/sec
Script Preparation code:
Tests:
  • Map

  • For Loop

  • foreach

  • pre-allocated for loop

  • pre-allocated unrolled for loop

  • ++for loop

  • --for loop