DevTools profiling & debugging
Performance panel flame charts, memory snapshots for leaks (detached DOM nodes), React Profiler. Measured claims beat vibes in interviews and in prod.
The mental model
DevTools is a microscope for a running page. Debugging with it is the discipline of replacing "it feels slow" and "it must be React" with a measured signal that names the actual cause. The engineer who can open the Performance panel, record ten seconds, and point at the exact 180ms function is worth far more than the one with a strong hunch, because the hunch is wrong often enough to waste days.
The analogy: a doctor. A patient says "I feel tired." A bad doctor guesses and prescribes; a good one orders the specific test — bloodwork, an ECG, an imaging scan — that turns a vague symptom into a named cause. DevTools panels are those tests. The Performance panel is the ECG (what is the main thread doing over time), the Memory panel is the imaging scan (what is being retained and why), the Network panel is the bloodwork (what is arriving, when, and how big), and the React Profiler is the specialist consult (which components rendered and why). The skill is not knowing every panel exists — it is knowing which test the symptom calls for.
**Why this exists — what breaks without it.** Performance and memory problems are invisible to reading code. A re-render storm, a detached-DOM leak, a layout thrash, a long task blocking input — none of them show up as a red squiggle or a thrown error. They show up as a page that gets slower the longer it runs, an interaction that lags on a cheap phone, a tab that eats a gigabyte after an hour. Without measurement you optimise by superstition: you memo everything, you useMemo values that were never the problem, you add a cache to a function that ran once. Measurement replaces that with a trace that says "this, here, for this reason" — which is also what makes your claim credible in a code review and in an interview.
The organising principle: measure, change one thing, measure again. A performance fix without a before-and-after is a guess wearing a lab coat.
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision