Part 2: Deep diagnosing an app’s execution
In the first part of this book, we focused on problems you can catch by reading the code, stepping through it with a debugger, or checking well-written tests. But some issues only reveal themselves when the application is running under real conditions.
This part is about tracking down problems in execution—specifically, those tied to CPU usage and multithreading behavior. These are the kinds of issues that cause slow responses, uneven performance, or sudden bottlenecks even when the code looks fine. You won’t find them just by reading source files—you need profiling tools that show exactly what the CPU is busy doing and where time is being spent.
We’ll explore techniques for identifying excessive CPU consumption, spotting inefficient code paths, and uncovering hidden synchronization problems. You’ll also learn how to investigate blocked threads, lock contention, and deadlocks—issues that can quietly grind an application to a halt.
By the end of this part, you’ll be able to diagnose and fix CPU-related execution problems with confidence, using the right tools to see what’s really happening behind the scenes.