Flame graph in React DevTools Profiler is a visualization of rendering time for each component during one update phase.
How it works step-by-step:
How to read:
Analysis example:
App (120ms)
├── Header (2ms) — fast, ok
├── Sidebar (3ms) — fast, ok
└── Content (115ms) — problem!
├── FilterBar (5ms)
└── DataTable (110ms) — BOTTLENECK
├── Row (2ms × 100)
└── Cell (0.5ms × 1000)
What to look for:
React.memo or split context).Actions:
actualDuration vs baseDuration.baseDuration >> actualDuration — memoization helps (component is expensive but rarely changes).actualDuration >> baseDuration — memoization hurts (component is cheap but re-renders often).Configuration options:
Performance considerations:
actualDuration > 16ms (one frame at 60fps).Common optimizations based on flame graph findings:
React.memo, useMemo, useCallback.react-window.use-context-selector.