- All Courses
- React Performance Engineering
- Measuring Before You Optimize
- Reading a flame graph
Reading a flame graph
In a flame graph each bar is a function call: how wide it is tells you how long it ran, and what sits beneath it tells you what it called.
Overview
Width is time, depth is who called whom
In a flame graph each bar is a function call: how wide it is tells you how long it ran, and what sits beneath it tells you what it called. Wide bars are your targets; deep stacks are just structure.
Anything over fifty milliseconds on the main thread is a long task, and long tasks are what make an interface feel unresponsive — during one, the browser cannot respond to input at all.
Check what kind of work the bar represents before optimising it. Time spent in layout and paint is not fixed by memoising a component; that is a CSS or DOM-size problem wearing a React costume.
In this lesson you will:
- Read width as time and depth as call stack
- Spot long tasks that block the main thread
- Separate script time from layout and paint
Resources
Notes are not saved yet — they clear when you leave this page.
Core Web Vitals in the field
15m
Why components re-render
5m