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 69.4 Ops/sec
Loop (for...in) with .keys() 520.5 Ops/sec
Loop (for...in) with .entries() 779.0 Ops/sec
Loop (for...in) with .entries() and .fromEntries() 554.0 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


;