perf
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| perf [March 21, 2026 at 18:33] – yanevskiv | perf [August 22, 2026 at 15:22] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | # perf | ||
| + | |||
| + | **perf** is a Linux profiling tool that reads hardware performance counters from the CPU. Measure cycles, instructions, | ||
| + | |||
| + | Unlike guessing, perf gives ground truth from the hardware. Low overhead (1-5%), no recompilation needed, and the data is reliable. In HPC work, perf is the first tool to reach for when something is slower than expected. | ||
| + | |||
| + | ```bash | ||
| + | $ perf stat ./program | ||
| + | Performance counter stats for ' | ||
| + | | ||
| + | 16, | ||
| + | 12, | ||
| + | | ||
| + | ``` | ||
| + | |||
| + | IPC (instructions per cycle) of 0.73 on a modern superscalar CPU means the pipeline is stalled. A 33% cache miss rate means it's waiting for memory. Two numbers tell you everything you need to know to start optimizing. | ||
| + | |||
| + | ## Concepts | ||
| + | |||
| + | 1. [[perf-basics|Basics]] | ||
| + | 2. [[perf-stat|perf stat]] | ||
| + | 3. [[perf-record|perf record]] | ||
| + | 4. [[perf-report|perf report]] | ||
| + | 5. [[perf-annotate|perf annotate]] | ||
| + | 6. [[perf-events|Events]] | ||
| + | 7. [[perf-metrics|Metrics]] | ||
| + | 8. [[perf-flame-graphs|Flame graphs]] | ||
| + | 9. [[perf-sampling|Sampling]] | ||
| + | 10. [[perf-scripting|Scripting]] | ||
