Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36
Chrome 86
Windows
Desktop
4 years ago
Test name Executions per second
forEach #1 1045340.9 Ops/sec
fromEntries and map #1 611435.6 Ops/sec
Object.assign and map #1 575942.2 Ops/sec
reduce #1 630379.4 Ops/sec
for 468791.9 Ops/sec
forEach #2 1037795.9 Ops/sec
fromEntries and map #2 610362.1 Ops/sec
Object.assign and map #2 583941.2 Ops/sec
reduce #2 653693.0 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


;