Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0
Firefox 88
Windows
Desktop
3 years ago
Test name Executions per second
forEach #1 6673378.5 Ops/sec
fromEntries and map #1 3062356.2 Ops/sec
Object.assign and map #1 1418974.1 Ops/sec
reduce #1 1770659.4 Ops/sec
for 8590543.0 Ops/sec
forEach #2 5695607.0 Ops/sec
fromEntries and map #2 2911786.5 Ops/sec
Object.assign and map #2 1471869.6 Ops/sec
reduce #2 1724421.2 Ops/sec
Script Preparation code:
Tests:
  • forEach #1

  • fromEntries and map #1

  • Object.assign and map #1

  • reduce #1

  • for

  • forEach #2

  • fromEntries and map #2

  • Object.assign and map #2

  • reduce #2