Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0
Firefox 82
Windows
Desktop
4 years ago
Test name Executions per second
forEach #1 9136916.0 Ops/sec
fromEntries and map #1 8092141.5 Ops/sec
Object.assign and map #1 2388199.0 Ops/sec
reduce #1 2180897.5 Ops/sec
for 11210743.0 Ops/sec
forEach #2 9134309.0 Ops/sec
fromEntries and map #2 7742101.5 Ops/sec
Object.assign and map #2 2353696.5 Ops/sec
reduce #2 2184378.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