Reading the Profiler Flamegraph
What you'll learn: How to interpret the Profiler's flamegraph view to pinpoint which components are rendering slowly and how often they render.
Understanding the Flamegraph Layout
The flamegraph visualizes your component tree as a series of horizontal bars stacked vertically. Each bar represents a component that rendered during the profiled session. The width of each bar indicates how long that component took to render—wider bars mean slower renders. The color intensity (yellow to orange) also reflects render duration, with brighter colors indicating more time spent.
Components are stacked hierarchically: parent components appear above their children. This layout makes it easy to spot which parts of your tree are expensive.
Reading the Data
When you hover over a bar, you'll see:
- Component name
- Render duration (in milliseconds)
- Number of times it rendered during this commit
The flamegraph helps you answer two critical questions:
- Which components are slowest? Look for the widest, brightest bars
- Which components render most frequently? Check the render count on hover
What to Look For
Unexpectedly wide bars: If a small, simple component shows a surprisingly wide bar, investigate why it's slow. Could be expensive calculations, heavy child trees, or missing memoization.
Frequent renders: Components rendering dozens of times during a single interaction suggest unnecessary re-renders—possible candidates for React.memo or state optimization.
Cascading patterns: A parent component with many wide children suggests a rendering cascade where updates flow through multiple layers unnecessarily.
Key Takeaway: The flamegraph's bar width reveals render duration, while color intensity and hover data show frequency—together, they help you identify the slowest and most frequently rendering components in your tree.