GoalMeasure before optimizing. Use the right tool (Profiler, Lighthouse, DevTools Memory), fix real bottlenecks, and hunt the memory leaks we've described since Level 2.
Lessons
Measure first — always
The #1 rule: never optimize by guessing. Intuition is wrong more often than right.
Chrome DevTools → Performance — flame chart of main thread, finds long tasks
React DevTools → Profiler — which components re-rendered, how often, why
INP directly maps to Level 3's "blocking the main thread". Heavy synchronous work in a click handler → high INP.
Virtualization
For long lists, the fix is NOT memoizing each row. The fix is only rendering visible rows.
Full list (10,000 rows) → 10,000 DOM nodes → freezes
Virtualized → ~25 DOM nodes visible → constant, smooth
Libraries: react-window, @tanstack/react-virtual.
memo on list rows treats the symptom (re-renders). Virtualization treats the cause (too many DOM nodes).
Memory Leak Hunting
Symptom: app slows down over time, memory climbs, never drops.
Diagnosis: Chrome DevTools → Memory → Heap Snapshots. Take one, do the suspect action several times, take another. Compare — objects that should be gone but aren't = leak.
setInterval/setTimeout never cleared
addEventListener never removed
WebSocket/observable subscription never unsubscribed