Perspectives · Linux Performance
Linux perf: Measure the Bottleneck Before Optimizing Code
Profiling replaces guesses with evidence.
Profiling replaces guesses with evidence. Linux perf can sample CPU execution and report hot functions and call paths, subject to kernel configuration, permissions, and symbol availability. Define the symptom, measure a baseline under representative load, and preserve the exact binary and matching debug symbols.
CPU profiles do not explain every kind of slowness. A process waiting on disk, network, locks, or another service may use little CPU while latency remains high. Compare profiles with I/O statistics, process state, metrics, and request timing. Change one meaningful thing, repeat the measurement, and check whether the bottleneck moved.