React DevTools Profiler?
The Profiler tab in React DevTools records what React rendered during an interaction: each commit, which components rendered, how long each took, and (with the setting enabled) why each component rendered. Use it to find slow components and unnecessary re-renders before optimizing.
How to use it
- Open React DevTools, go to Profiler, and press record.
- Perform the slow interaction (typing, opening a panel).
- Stop recording and review commits in the bar chart at the top.
- Flamegraph: the component tree for a commit; width and color show render time; gray means the component did not render.
- Ranked chart: components sorted by render time.
- Click a component to see its render times across commits and why it rendered ("Props changed: onSelect", "Hook 2 changed", "The parent component rendered", "Context changed").
Settings worth enabling
- "Record why each component rendered while profiling".
- "Highlight updates when components render" (Components tab settings) for a quick visual check.
Programmatic profiling
<Profiler id="Table" onRender={(id, phase, actualDuration, baseDuration) => ...}> measures a subtree in code, useful for logging or CI checks.
Production profiling
Development builds are slower than production. For realistic numbers, build with the profiling bundle (react-dom/profiling), for example next build --profile.
Complement with Chrome DevTools
React 19.2 adds React tracks to the Chrome Performance panel (Scheduler and Components), so you can see React work alongside network, layout and paint.
Interpreting results
Look for components that render often with the same props (candidates for memoization or state restructuring) and for single slow renders (heavy computation or huge lists to virtualize).
Code example
1import { Profiler, type ProfilerOnRenderCallback, useState } from "react";23const onRender: ProfilerOnRenderCallback = (id, phase, actualDuration, baseDuration, startTime, commitTime) => {4 // actualDuration: time spent rendering this commit; baseDuration: estimate without memoization5 if (actualDuration > 8) {6 console.warn(`[${id}] ${phase} took ${actualDuration.toFixed(1)}ms (base ${baseDuration.toFixed(1)}ms)`, { startTime, commitTime });7 }8};910function BigTable({ rows }: { rows: number[] }) {11 return <table><tbody>{rows.map((r) => <tr key={r}><td>{r}</td></tr>)}</tbody></table>;12}1314export function Report() {15 const [rows, setRows] = useState(() => Array.from({ length: 2000 }, (_, i) => i));16 return (17 <Profiler id="BigTable" onRender={onRender}>18 <button onClick={() => setRows((r) => [...r].reverse())}>Reverse</button>19 <BigTable rows={rows} />20 </Profiler>21 );22}
Practice this question
Open it in the study app to track progress, take notes, listen to the answer and work through the rest of the React set.