Skip to main content

Profiler and React Performance Tracks

Performance work becomes more reliable when you can see what scheduled work, how long it rendered, what committed, what Effects cost, and how React work overlaps browser/network activity.

Three complementary profiling layers​

Choose the profiling surface for the question
React DevTools Profiler
Interactive component/commit investigation
<Profiler>
Programmatic subtree measurements
Performance Tracks
React scheduling/components/server work on browser timeline

They overlap, but they do not provide identical information.

<Profiler>​

import { Profiler } from 'react';

<Profiler id="SearchResults" onRender={onRender}>
<SearchResults />
</Profiler>

Typical callback:

function onRender(
id,
phase,
actualDuration,
baseDuration,
startTime,
commitTime,
) {
console.table({
id,
phase,
actualDuration,
baseDuration,
startTime,
commitTime,
});
}

Use IDs that map to product regions such as SearchResults, CheckoutSummary, or DashboardChart.

actualDuration vs baseDuration​

Profiler durations answer different questions
actualDuration
Work React actually rendered for this update
baseDuration
Estimated subtree render cost without memoization reuse

Example:

actualDuration: 8 ms
baseDuration: 90 ms

suggests substantial work was skipped.

If both are tiny, more manual memoization is unlikely to matter.

Profiling adds overhead​

Normal production builds disable profiling instrumentation by default. React provides a profiling build for production-like performance investigation.

Use profiling to locate and compare bottlenecks, then validate important improvements under realistic production conditions.

React DevTools Profiler​

Useful questions include:

  • Which components rendered in this commit?
  • Which subtree took the most time?
  • What triggered the update?
  • Did Context fan out broadly?
  • Did moving state shrink the update surface?
  • Did a targeted optimization reduce cost?

A flamegraph is evidence, not a verdict. Rendering itself is normal.

React Performance Tracks​

React 19.2 introduced React-specific tracks for supported browser Performance panels. They align React work with JavaScript tasks, network activity, event-loop work, layout, and paint.

One timeline, several React views
Scheduler
Priority + update/render/commit/effect timing
Components
Component and Effect duration flamegraphs
Server
RSC requests, Promises, async component work in development

Current React guidance: Performance Tracks are available in development and profiling builds. Server tracks are development-only; profiling builds have more limited component/server instrumentation unless enabled through supported tooling.

Scheduler priorities​

Blocking
Synchronous/high-priority work
Transition
Non-blocking background work
Suspense
Fallback/retry/reveal work
Idle
Lowest-priority work

This makes the concurrency mental model observable rather than theoretical.

Render phases on the timeline​

A scheduled update has multiple phases
1Update β€” what scheduled work
2Render β€” calculate next tree
3Commit β€” mutate DOM + layout Effects
4Remaining Effects β€” passive synchronization

A slow interaction can therefore be decomposed by phase instead of blamed generically on β€œReact.”

Cascading updates​

Performance Tracks can expose update cascades
Commit A
First update finishes
New update
Extra work begins
Commit B
Potential avoidable second pass

Development traces can help identify which component scheduled the extra update.

Components track​

The Components track visualizes component durations and Effect durations as flamegraphs.

Events may include Mount, Unmount, Reconnect, and Disconnect. Reconnect/Disconnect are particularly useful with <Activity>, where hidden UI can preserve state while Effects disconnect and reconnect.

Changed props​

Development traces can show potential changed props for a component render.

Changed identity can explain an expensive render
items
same
query
same
onSelect
new function identity

That is evidence for a targeted identity/API fixβ€”not proof that every callback needs useCallback.

Profile Effects independently​

A component can render in 2 ms and run an 80 ms Effect.

Common causes include synchronous third-party work, duplicated subscriptions, state-update loops, serialization/parsing, and layout reads/writes.

Server tracks and waterfalls​

Development Server Performance Tracks can expose Promises feeding Server Components and async component durations.

Serial server awaits can create a waterfall
ProductPage awaits product
120 ms
Reviews awaits reviews
150 ms

If the work is independent, start it concurrently instead of accepting the serial critical path.

Development vs profiling builds​

Development
Broad diagnostics; Server tracks available; extra dev overhead
Profiling build
Closer to production; profiling instrumentation intentionally enabled

React documents using react-dom/profiling through a bundler alias for profiling builds. Your framework may expose a supported mode.

Meaningful Profiler boundaries​

Do not permanently wrap every tiny component.

Good boundaries map to product subsystems:

Dashboard
ChartPanel
ActivityFeed
SearchResults
CheckoutSummary

That makes measurements understandable and avoids drowning in instrumentation noise.

Compare before and after​

1Record baseline
2Change one architectural/optimization cause
3Record same interaction again
4Validate user experience improved

Run multiple samples and control dataset, device, browser, network, cache state, and interaction sequence.

Production observability​

A useful performance trace crosses subsystem boundaries
User interaction
Latency / responsiveness
React
Commits / scheduling
Network + server
Spans / waterfalls
Browser
Long tasks Β· layout Β· paint

Common mistakes​

  • Profiling only the entire app without meaningful subsystem boundaries.
  • Profiling tiny demos that do not resemble production data/composition.
  • Treating every render as wasted.
  • Ignoring Effect duration.
  • Ignoring browser layout/paint.
  • Leaving profiling instrumentation enabled in normal production unintentionally.
  • Drawing conclusions from one noisy trace.

Interview questions​

<Profiler> vs Performance Tracks?​

<Profiler> gives programmatic subtree measurements. Performance Tracks place React scheduling/component/server events on the browser performance timeline alongside other platform work.

Why can profiling builds differ from normal production?​

Profiling instrumentation adds overhead and metadata that normal production removes.

What is a cascading update?​

An update scheduled during or immediately after existing React work that causes another render pass, often from Effect-driven derived state.

Why inspect changed props?​

Changed identity can explain why an expensive child rendered and whether a targeted memoization or API redesign would help.

References​