Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Chrome 107
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
Get from array (all hits) 37519.4 Ops/sec
Get from array (with misses) 11229.0 Ops/sec
Get from map (all hits) 37396.1 Ops/sec
Get from map (with misses) 9129.9 Ops/sec
Iterate array 1372793.8 Ops/sec
Iterate map 1249797.0 Ops/sec
Script Preparation code:
Tests:
  • Get from array (all hits)

  • Get from array (with misses)

  • Get from map (all hits)

  • Get from map (with misses)

  • Iterate array

  • Iterate map