Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0
Firefox 82
Linux
Desktop
4 years ago
Test name Executions per second
forEach #1 7937724.5 Ops/sec
fromEntries and map #1 6736659.5 Ops/sec
Object.assign and map #1 2002768.8 Ops/sec
reduce #1 1768337.0 Ops/sec
for 9721610.0 Ops/sec
forEach #2 8348190.0 Ops/sec
fromEntries and map #2 6747724.5 Ops/sec
Object.assign and map #2 1984011.4 Ops/sec
reduce #2 1763782.8 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