Skip to main content

Performance visual mental model

Performance work starts with evidence about user impact, not with adding memoization Hooks by habit.

A user interaction crosses many performance layersA slowdown can live outside React entirely.
1User input
2Event handler
3State update / scheduling
4React render work
5Commit
6Style / layout / paint
7Effects / follow-up work

Find the bottleneck before choosing the fix​

Different symptoms need different tools
Rendering cost
Profiler · state placement · component boundaries
Network latency
Waterfalls · caching · preloading · server ownership
Bundle cost
Code splitting · dependency review · lazy loading
Browser work
Layout · paint · images · CSS · DOM size
Scheduling
Transitions · deferred values · urgent vs non-urgent work
Third-party cost
Scripts · analytics · widgets · SDK initialization

Memoization only addresses a narrow class of problems​

When memoization can help
A render path is measurably expensive
Inputs are often unchanged
Skipping/reusing work costs less than recalculating it
What is slow?
One component re-renders expensivelyProfile state placement, props, and memoization opportunities
Typing feels blocked while a large result updatesInspect scheduling and transition/deferred-value options
Page waits on serial requestsFix the network/server waterfall
Initial load is heavyMeasure bundle, hydration, images, and third-party code
Rendering is fast but the browser janksInspect layout, paint, long tasks, and DOM/CSS cost

State placement is a performance tool​

State scope controls render scope
Too broadHigh state owner
A tiny local change can force a large subtree to participate in rendering.
FocusedState near consumers
Only the region that owns or consumes the interaction needs to update.

Production optimization loop​

1Reproduce user symptom
2Measure
3Identify bottleneck
4Apply targeted change
5Measure again
6Keep only proven wins

Keep this mental model​

Performance in one picture
Measure
Start from evidence.
Locate
Find the real layer.
Target
Choose the narrow fix.
Verify
Prove the result improved.

Continue with Measure Before Optimizing for profiling workflows, React DevTools, browser traces, memoization, and production performance strategy.