How I Made Immer Twice as Fast: Performance Optimization in Practice
summary
An investigation of Immer finds micro fixes (caching constructor lookups, switching reflect.keys to object.keys, early frozen checks) that yield about +18% across benchmarks, a large architectural rewrite of finalization that adds roughly +5%, and an optional array plugin that bypasses proxies to remove huge read-path overheads; overall scenarios improve between 5% and ~75% (not a universal 2x). Work uses benchmarking with mata, CPU profiles via pprof/poff, Chrome DevTools and SpeedScope, and ships changes in 10.2, 11.0 and 11.1.
AI-written summary · about
chapters (9)
- 0:00Introduction and speaker intro
- 3:38What is Immer and why it matters
- 7:54Why Immer became slow over time
- 16:10Performance investigation principles
- 25:46Debugging Immer with benchmarks
- 30:28Profiling and hotspots in Immer
- 36:12Techniques used to optimize Immer
- 39:50My day job at Replay
- 44:27Call to action and closing








