A slow React interaction can involve several component updates before the screen settles. Use React Profiler to identify which subtree does the rendering work, then compare the same interaction before and after one focused change.
Define the interaction before collecting timings
Start with one reproducible action: selecting a product filter, changing a dashboard tab or expanding a table row. Describe the initial screen, the data already loaded and the visible result that marks completion. A vague instruction such as “click around the page” produces recordings that cannot support a useful comparison.
Keep a small experiment sheet containing the application revision, build mode, browser, device, dataset size and exact action sequence. Include whether the page has just mounted or has already completed the interaction once. The first attempt may exercise setup work that later attempts reuse. Mixing those conditions can make an unchanged application appear faster.
Choose an observation boundary around the feature that feels slow. A profiler around the entire application is useful for orientation, but a result for that large tree rarely identifies the next edit. A profiler around a single tiny label can miss the parent update causing the problem. Start with a meaningful region such as the results panel, then narrow it when the evidence justifies doing so.
Write the expected behavior alongside the performance question. After a filter changes, the row count, selected values and empty state must still agree. An optimization that skips a necessary update may produce an attractive duration while displaying the wrong result. Correctness is an acceptance condition throughout this workflow.
Understand the callback without inventing a page metric
The official React Profiler reference defines the callback and the supported measurement fields. Give each instrumented region a stable identifier so that records remain attributable when several regions update together. Store the callback values without rounding them prematurely or combining different phases into one undifferentiated average.
| Field | Practical use in this audit | Interpretation to avoid |
|---|---|---|
id |
Identify the measured component region | Treating an identifier as a user identifier |
phase |
Separate mount, update and nested update records | Comparing initialization with an ordinary interaction |
actualDuration |
Inspect rendering work for the current update | Calling it the complete input-to-screen delay |
baseDuration |
Provide context for estimated full-tree rendering work | Treating the estimate as a guaranteed optimization saving |
startTime |
Locate the beginning of the recorded render | Assuming elapsed wall time is active CPU time |
commitTime |
Group profiler records belonging to the same commit | Treating the timestamp as a duration |
These fields describe React work within the chosen boundary. They do not establish the duration of a network request, the browser's layout work or the complete experience of an interaction. Keep the distinction explicit in your report. “The results region rendered less work” is a narrower, defensible statement than “the page became this many milliseconds faster.”
React supports multiple profilers and nested boundaries. That flexibility is useful when the results panel contains a costly editor or visualization. However, a parent region already covers its descendants. Adding the parent's duration to a nested child's duration can count overlapping work twice. Present nested measurements as a breakdown rather than as independent contributions to a total.
Collect a small, bounded record
Use the callback to append lightweight records to a bounded buffer. Keep component identifiers technical and stable, such as ResultsPanel or ChartPreview. Avoid including search text, account names, raw props or other user content. This audit needs timing context and a reproducible test case, not copies of application data.
Do not update React state from the measurement callback merely to show a live counter. That instrumentation can introduce additional application work and complicate the very recording you are trying to understand. A verbose console entry for every callback can also distract from the important sequence. Export the collected sample after the controlled action has completed.
A useful local record pairs each timing entry with a run identifier and a manually assigned scenario label. The run identifier distinguishes repeated experiments; the scenario label describes the action without personal information. Keep an upper bound on the buffer and record whether entries were dropped, otherwise a long session can silently bias the sample toward its final portion.
Start by confirming that the instrumentation actually observes the selected region. Perform one known update and inspect the region identifier and phase. Then remove any temporary test action before measuring the real scenario. If no records appear, check the build and profiler placement before concluding that the feature performs no rendering work.
Compare builds and repeated runs fairly
Profiling has an overhead. React disables it in the ordinary production build by default, and production profiling requires a specially enabled build. Record that distinction instead of assuming that adding a boundary to an ordinary release creates production timing data. Follow the build integration appropriate to the application and verify the resulting artifact.
Development measurements are useful for locating suspicious work, but they are not a promise about what production users experience. Compare the baseline and candidate using the same profiling configuration. Do not measure one revision in development and the other in an optimized production profiling build, then attribute the difference entirely to your code change.
Run the same sequence several times under comparable conditions. Keep initial mounts separate from subsequent updates, and distinguish a warmed interaction from a fresh page load. If another tab, background process or network request changes the conditions substantially, mark that run instead of quietly selecting the most favorable number.
Report a small distribution or the individual repeat values, together with the test conditions. A single unusually fast run is weak evidence. Choose the number of repeats before looking at the outcome, and retain unfavorable runs unless a documented condition invalidates them. This discipline makes a modest improvement more credible and makes a failed hypothesis easier to abandon.
Group commits and investigate the expensive region
Use the shared commitTime to associate records from different profiler boundaries with one commit. Preserve their individual region identifiers. This helps answer whether the results table and summary panel updated together or whether a later update followed the first one. Keep mount and update phases visible in the grouped view.
A large actualDuration in a region points to rendering work worth investigating. It does not by itself explain which calculation, component or dependency caused that cost. Inspect the region's component behavior and the triggering state change. Look for work repeated despite unchanged inputs, unnecessarily broad state ownership or a large collection rendered for a small visible change.
Compare actualDuration with baseDuration as context, not as a universal score. A low actual value relative to the estimate may indicate that reuse is effective for that update, but the absolute work and user journey still matter. A mount and an update can have different needs, and the estimate changes as component render history changes.
Avoid immediately adding memoization to every component. First state a concrete hypothesis: for example, a parent recreates inputs for an otherwise unchanged expensive child. Then make the smallest change that addresses that behavior. Recheck the complete feature, including keyboard use and alternate data states, because stable references are useful only while the displayed information remains correct.
Connect the result to browser evidence
Record a browser performance trace for the same slow action. Align the rough sequence of React updates with the surrounding browser work and visible completion. The purpose is to find the remaining bottleneck, not to force every interval into a React explanation. A shorter render can coexist with a late paint or a delayed request.
For a feature delivered through Next.js, the Next.js performance guide provides the broader context of rendering and client boundaries. Keep this experiment focused on the component region rather than changing data delivery, bundle loading and state ownership simultaneously. Several changes at once make the result difficult to explain or reverse.
Use the field and laboratory measurement guide when deciding how a controlled result relates to real visits. The profiler experiment supports a local engineering conclusion. Field measurements answer a different question about the population using the site. Do not substitute callback durations for Core Web Vitals or announce a field improvement before observing one.
Close the experiment with a reversible decision
Before merging, repeat the baseline scenario on the candidate revision and run the correctness checks written at the beginning. Save the source revision, build configuration, measurement boundaries, raw records and a short description of the change. Include a browser trace when it explains why the user-visible result did or did not improve.
Accept the change only when the evidence supports the intended behavior and the implementation remains understandable. If the measured region improves but the interaction does not, record that finding and investigate the next stage. If the improvement disappears under repeated runs, avoid presenting the best isolated sample as a result.
Remove temporary profilers and verbose instrumentation when the investigation ends, or retain only a deliberately scoped measurement setup with a clear owner. The final handoff should name the slow action, identify the region investigated, explain the change and state what remains unmeasured. That gives the next engineer a reproducible starting point instead of a timing number without a story.