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)

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    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)

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:105.0) Gecko/20100101 Firefox/105.0
Firefox 105 on Mac OS X 10.15
View result in a separate tab
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