Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
Chrome 112
Windows
Desktop
one year ago
Test name Executions per second
Reduce + spread 0.5 Ops/sec
Loop (for...in) with .keys() 82.1 Ops/sec
Loop (for...in) with .entries() 93.9 Ops/sec
Reduce + mutate 43.5 Ops/sec
Reduce + mutate with entries() 48.9 Ops/sec
Script Preparation code:
Tests:
  • Reduce + spread

  • Loop (for...in) with .keys()

  • Loop (for...in) with .entries()

  • Reduce + mutate

  • Reduce + mutate with entries()

  • Map with fromEntries

  • Loop (for...in) with mutate

  • Loop (for...in) with mutate (Object.assign)

  • Loop (for...in) with mutate (save object[key])

  • Loop (for...in) with unsafe mutate

  • Object.fromEntries with map


;