Course contentsShow
← React
Lesson 2223 of 2,39649. Performance: Identifying ProblemsFree lesson

Reading the Profiler Flamegraph

Understand the Profiler's flamegraph view to identify components that take the longest to render and their frequency.

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:

  1. Which components are slowest? Look for the widest, brightest bars
  2. 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.