perf is the main CPU profiler on Linux. It samples the processor
through a hardware counter (the PMU) every N milliseconds and records
stacks. The result: where function X spends the most time.
load-average tells you how busy the system is; perf tells you
on what exactly.
In this lesson you go through the minimal workflow:
- Start a CPU-bound load
perf recordtakes samplesperf reportshows the top functions- You learn how to read the result
⚠️ Caveat: PMU sampling on a VM (the OrbStack VM) can be limited: some events may be unavailable. Basic CPU-time profiling works.