Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Firefox 78
Windows
Desktop
4 years ago
Test name Executions per second
forEach #1 1580072.0 Ops/sec
fromEntries and map #1 1559094.6 Ops/sec
Object.assign and map #1 627619.4 Ops/sec
reduce #1 596842.9 Ops/sec
for 2942483.5 Ops/sec
forEach #2 2507513.5 Ops/sec
fromEntries and map #2 1551316.5 Ops/sec
Object.assign and map #2 624787.0 Ops/sec
reduce #2 552920.9 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