Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk5 min

React Performance: How to Find and Fix Slow Work

Profile the interaction that is slow, find the work responsible, then choose a targeted fix. Learn when React memoization hooks and React Compiler help—and how to verify the result.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start by profiling the interaction that feels slow. Then optimize the specific component or calculation the profile identifies, and measure the same interaction again. React’s memo, useMemo, and useCallback can help in targeted cases, while React Compiler can handle many memoization decisions automatically in new code. None is a substitute for evidence that a change helps.

How to find the work that is slowing an interaction

  1. Reproduce one slow interaction. Choose a concrete action—such as typing in a particular field or opening a panel—and use the same data and sequence each time.
  2. Record a profile. In React Developer Tools, use the Profiler to inspect which components rendered during that interaction and where the work accumulated. React recommends profiling to identify candidates for memoization; a component rendering is not, by itself, proof that it needs optimization. React’s memo reference
  3. Isolate the cause. Look for an expensive subtree, repeated costly calculation, or update that causes more of the tree to render than necessary. Check whether state or context changes explain the render before adding a memoization hook.
  4. Change one cause and profile again. Compare the same interaction under comparable conditions. Keep the change only if the measured work or user-visible delay improves.

Do not treat a render-time number as a universal performance score. React Profiler measurements describe a particular tree and update, and the profiling machinery itself adds overhead. Development timings can also differ from production behavior.

As an Amazon Associate I earn from qualifying purchases.

When memo can skip a component render

memo(Component) lets React usually skip rendering a component when its props compare equal to the previous props. It is most useful when the component renders repeatedly with the same props and its rendering work is meaningfully expensive. React’s own wording is direct: “memoization is a performance optimization, not a guarantee.” React, memo

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Stable props are essential

New objects and functions created during a parent render have new identities, even if their contents or behavior look unchanged. Passing them to a memoized child can make its props appear changed and defeat the optimization.

const options = { sort: "recent" };
return <Results options={options} />;

In this example, the parent creates a fresh options object each time it renders. If profiling shows this identity change is causing an expensive child to render unnecessarily, consider restructuring the data flow or stabilizing the value with useMemo. Do not add stabilization automatically: the fix itself has a cost and should address a measured problem.

What memo does not prevent

Equal props do not guarantee that a component will never render. Its own state or context can change, and React may render it for other reasons. The component must remain correct whether React renders it or skips a render; memoization is not a correctness mechanism.

When to use useMemo and useCallback

These hooks preserve a value or function identity across renders while their dependencies remain unchanged. Use them when that stability avoids work that profiling has shown to matter—not as decoration on every component.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Tool What it can avoid When it may help
memo A component render Props stay equal and the component’s render work is significant.
useMemo Repeating a calculation or creating a value with a new identity A calculation is noticeably costly, or stable value identity enables another optimization.
useCallback Creating a new function identity A stable callback is needed by a memoized child or as a dependency that would otherwise trigger unnecessary work.
React Compiler Work it can identify for automatic memoization The project is configured to use the compiler and the code is compatible with its requirements.

useMemo: cache a measured calculation or value

useMemo caches the result of a pure calculation between renders. React compares each listed dependency with its previous value using Object.is; if a dependency changes, the calculation runs again. It does not make the first render faster. React, useMemo

const visibleItems = useMemo(
  () => filterItems(items, query),
  [items, query]
);

This is useful only if recalculating visibleItems is costly enough to matter, or if preserving its identity enables another optimization. If the calculation is cheap, caching can add complexity without a useful payoff.

useCallback: preserve a function identity when it matters

useCallback is the function counterpart: React retains the function identity while its dependencies remain unchanged. It can help when passing a callback to a memoized child or when a function’s identity is an important dependency. A callback wrapper does not automatically stabilize new inline functions created deeper in the tree; follow the value to the component that receives it and confirm which identity is changing.

Keep dependencies complete

List every reactive value used by the calculation or callback. Omitting a dependency can leave the cached work using stale values and cause incorrect behavior. Use the React Hooks lint rules to flag dependency mistakes. These hooks are performance tools, not semantic storage: React may discard a cache in documented situations, so application correctness must not depend on it. React, useMemo React Compiler introduction

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Try structural fixes before adding hooks

Many slow update chains are better addressed by changing what causes the work than by memoizing around it.

  • Keep transient state close to where it is used. A local input state, for example, need not trigger a broad parent subtree to render if the state can live nearer the input.
  • Pass JSX as children to wrapper components where appropriate. A wrapper that updates its own state may avoid needlessly re-rendering its unchanged children when the structure allows them to be passed through.
  • Keep render logic pure. Rendering should calculate output from current inputs rather than perform side effects or mutate values. Pure rendering makes behavior predictable and optimization safer.
  • Remove unnecessary Effects that update state. An Effect-driven state update can create an extra render or an update chain. Derive values during render when appropriate, and remove dependencies or Effects that do not represent a genuine external synchronization need.

These approaches can prevent excess work without introducing dependency lists or manual cache management. React discusses them alongside memoization in its memo and useMemo guidance.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How React Compiler changes manual memoization

React Compiler is a build-time tool that can automatically memoize components and values by analyzing React data flow. For new code in a project using the compiler, React’s guidance is to rely on compiler memoization rather than routinely adding manual memo, useMemo, and useCallback. React Compiler Introduction

Compiler adoption does not remove the need to profile: it does not tell you which user interaction is slow or prove that the experience improved. For existing code, preserve manual memoization unless you have a reason to change it; remove annotations only after careful testing. Compiler setup and compatibility requirements are project-specific, so follow the official guidance for the version and configuration you are adopting. React Compiler directives

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Measure the result in an appropriate environment

Development behavior can distort timing comparisons, and React’s Profiler adds overhead. The ordinary production build does not include profiling support; profiling production behavior requires a special profiling-enabled build. The <Profiler> API can report actualDuration, the render time for the current update, and baseDuration, an estimate of the subtree’s render cost without optimizations. Treat both as measurements of that profiled tree and update, not as universal benchmarks. React, Profiler

  • Profile the same interaction before and after the change.
  • Keep the input data, sequence, and environment comparable.
  • Use production-like behavior for user-facing timing; use a profiling-enabled build when you specifically need production profiling.
  • Retain only changes that improve the observed issue without making the code harder to keep correct.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.