Identifying Bottlenecks
Measure before optimizing.
Measure, Don't Guess
The first rule of performance work: measure before you optimize.
Intuition about where a Java program spends its time is usually wrong. The JIT compiler, garbage collector, and caching all defeat hand-waving. Profile, find the real hotspot, fix that.
A Bottleneck Defined
A bottleneck is the part of the system that limits overall throughput or latency.
Optimizing anything else gives no visible benefit. Amdahl's Law makes this precise: if 90% of time is in one method, speeding up the other 10% can never give more than an 11% improvement.
All lessons in this course
- Identifying Bottlenecks
- Java Flight Recorder
- Analyzing with JDK Mission Control
- Common JVM Tuning Flags