Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0
Firefox 104
Windows
Desktop
2 years ago
Test name Executions per second
forEach #1 10276245.0 Ops/sec
fromEntries and map #1 7442708.5 Ops/sec
Object.assign and map #1 3632343.0 Ops/sec
reduce #1 3104651.5 Ops/sec
for 16240029.0 Ops/sec
forEach #2 10327516.0 Ops/sec
fromEntries and map #2 7483971.5 Ops/sec
Object.assign and map #2 3609575.5 Ops/sec
reduce #2 2944705.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