Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:105.0) Gecko/20100101 Firefox/105.0
Firefox 105
Mac OS X 10.15
Desktop
one year ago
Test name Executions per second
Array.map with Object.fromEntries 3553.8 Ops/sec
Array.map with new Map 1170.9 Ops/sec
Reduce with new Object (`{}`) (reusing object) 6117.0 Ops/sec
Reduce with new Object (`{}`) (creating temporary objects) 0.3 Ops/sec
Reduce with new Map (reusing map) 1350.2 Ops/sec
Script Preparation code:
Tests:
  • Array.map with Object.fromEntries

  • Array.map with new Map

  • Reduce with new Object (`{}`) (reusing object)

  • Reduce with new Object (`{}`) (creating temporary objects)

  • Reduce with new Map (reusing map)