skip to content
Ivan's wiki
Site Tools
Search
Tools
Show pagesource
Backlinks
Recent Changes
Media Manager
Sitemap
>
Recent Changes
Media Manager
Sitemap
perf
This page is read only. You can view the source, but not change it.
# perf **perf** is a Linux profiling tool that reads hardware performance counters from the CPU. Measure cycles, instructions, cache misses, branches—everything the CPU tracks natively. Answer the fundamental question: where is the program spending time, and why is it slow? 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 './program': 4,102.38 msec task-clock # 3.98 CPUs utilized 16,847,203,412 cycles # 4.107 GHz 12,334,901,088 instructions # 0.73 insn per cycle 401,292,771 cache-misses # 33.33% of cache refs ``` 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. [Basics](/perf-basics) 2. [perf stat](/perf-stat) 3. [perf record](/perf-record) 4. [perf report](/perf-report) 5. [perf annotate](/perf-annotate) 6. [Events](/perf-events) 7. [Metrics](/perf-metrics) 8. [Flame graphs](/perf-flame-graphs) 9. [Sampling](/perf-sampling) 10. [Scripting](/perf-scripting)
Page Tools
Show pagesource
Backlinks
Back to top