Measurement-First Defaults
Pack:
performanceParent skill: Profiling Before Optimizing Source:performance/profiling-before-optimizing/references/measurement-first-defaults.md
Prefer these in order
Section titled “Prefer these in order”- User-visible symptom
- Baseline metric
- Representative scenario
- Profiler capture
- Dominant hotspot
- Smallest optimization
- Re-measurement
Default profilers by layer
Section titled “Default profilers by layer”- React render cost: React DevTools Profiler
- browser main-thread cost: Chrome Performance panel
- Node.js CPU hotspots:
--cpu-prof - memory churn: heap snapshots or allocation profiling
Anti-pattern
Section titled “Anti-pattern”Do not use code style heuristics as a proxy for performance truth. A clean-looking abstraction can be cheap, and ugly code can still be fast enough.