Skip to content

Lesson 9 of 9 · 23m

Fast by Default: Systems That Keep React Fast

Turn individual optimizations into durable practice with dependency discipline, performance reviews, regression telemetry, and team defaults that make slow paths harder to ship.

Teams do not keep React applications fast through hero refactors. They keep them fast by making the slow path awkward. Performance culture is a set of defaults: dependencies are scrutinized, large customer fixtures exist, traces are easy to capture, budgets fail loudly, and product design acknowledges physics. If speed depends on one senior engineer remembering everything, it is already regressing.

Build a performance fixture, not a demo

Every serious React app needs datasets that resemble the customers who suffer most:

small tenant       50 records, minimal permissions
typical tenant     5,000 records, normal feature flags
large tenant       50,000 records, dense metadata, many users
pathological       malformed text, long names, missing images, mixed locales

The point is not perfect production replication. It is exposing scale-dependent behavior before users do, with fixtures stable enough for profile comparisons.

Add performance review to design review

Performance is cheapest at the whiteboard. Ask:

What is the largest realistic amount of data on this screen?
Which interactions must feel immediate?
Can this feature be lazy, paginated, cached, or server-driven?
What dependency does this design require?
What happens on a mid-range Android over poor Wi-Fi?

These are product questions. A beautiful live dashboard is a failure if it makes the core workflow unusable on customer hardware.

Watch dependencies like supply chain and runtime cost

Every dependency carries security surface and client execution cost. Before adding one, inspect size, transitive dependencies, maintenance, and tree-shaking behavior:

npx bundlephobia date-fns

Prefer narrow imports when supported. Do not cargo-cult tiny libraries either; one maintained standard dependency can beat six bespoke utilities. The point is deliberate selection.

Make regression evidence routine

Capture evidence in risky pull requests:

before/after interaction trace
bundle delta by route
profiler screenshot for large fixture
RUM dashboard link for rollout

A brief table is enough. If client filtering moves to the server, show the interaction improvement and the network tradeoff. Hiding costs makes future maintenance harder.

Defaults that prevent common pain

Healthy teams often standardize on:

server state in a query/cache layer, not ad hoc useEffect state
large lists require pagination or virtualization review
new dependencies require bundle impact notes
input feedback must not wait for server confirmation
route chunks owned intentionally, not generated accidentally

These are guardrails, not commandments. Exceptions are allowed when someone can articulate the tradeoff.

Do not optimize by folklore

React itself is rarely the bottleneck internet arguments imply. The bottleneck is the system: data shape, ownership, dependencies, layout, network behavior, and device constraints. Measure first, change one dominant cost, and verify in realistic conditions.

Field notes

  • Retrospectives should ask why the fast path was hard, not who wrote the slow line.
  • Feature flags help rollout measurement only if metrics include flag state.
  • Deleting dead code is performance work; dead JavaScript still ships and parses.
  • Durable wins are architectural: smaller ownership, fewer dependencies, clearer boundaries.

Was this lesson helpful?

Sign in to rate