Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0
Firefox 96
Ubuntu
Desktop
2 years ago
Test name Executions per second
forEach #1 9111748.0 Ops/sec
fromEntries and map #1 5902501.5 Ops/sec
Object.assign and map #1 2661502.2 Ops/sec
reduce #1 2156564.5 Ops/sec
for 14664929.0 Ops/sec
forEach #2 9199908.0 Ops/sec
fromEntries and map #2 4841261.5 Ops/sec
Object.assign and map #2 2659760.2 Ops/sec
reduce #2 2167884.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