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 8141834.5 Ops/sec
fromEntries and map #1 3995098.8 Ops/sec
Object.assign and map #1 1881928.1 Ops/sec
reduce #1 2274131.5 Ops/sec
for 14407366.0 Ops/sec
forEach #2 8416110.0 Ops/sec
fromEntries and map #2 4200767.0 Ops/sec
Object.assign and map #2 1989147.6 Ops/sec
reduce #2 2113043.5 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