Patterns 4 patterns
Performance
Optimization patterns for faster loading and smoother interactions. Load time is only part of performance, and the other part is how quickly the interface responds once someone starts using it. These patterns help you load less code up front and defer heavy work until it’s needed. They also cut down on repeated work, either by caching results or by waiting for rapid input to settle.
- Code Splitting Splitting your app's code into smaller bundles that load on demand, so users download less before the first page becomes usable.
- Debounce Debouncing waits until events stop for a short time before running a function, so a burst of rapid calls becomes a single call.
- Lazy Loading Code and images that only load when users need them, so the first page loads faster and uses less bandwidth.
- Memoization Caching the results of slow calculations lets your code skip recalculating them when the inputs haven't changed.