Make a React interface fast by measuring first

8 steps · about 4 h 15 min · Intermediate

  1. Trace render and commit work (guide, React documentation, 30 min)

    Identify what React calculates and what it actually changes in the browser.

  2. Install the React profiler (guide, React documentation, 25 min)

    Capture component timings and repeated renders instead of guessing from code shape.

  3. Remove avoidable effects (guide, React documentation, 35 min)

    Calculate derived values during rendering and keep event-specific work in event handlers.

  4. Simplify state dependencies (guide, React documentation, 35 min)

    Avoid redundant and contradictory state that triggers extra updates and synchronization.

  5. Memoize a measured component (reference, React documentation, 30 min)

    Skip a costly child render only after confirming stable props and a real bottleneck.

  6. Cache an expensive calculation (reference, React documentation, 30 min)

    Preserve a costly pure result between renders without using memoization for correctness.

  7. Keep urgent input responsive (reference, React documentation, 30 min)

    Allow a slow result view to lag behind typing while clearly showing stale content.

  8. Verify the user-visible improvement (guide, web.dev, 40 min)

    Repeat the same interaction and compare profiler evidence with browser responsiveness metrics.