Profiling
ELI5 - The Vibe Check
Profiling is watching your program run and keeping score of where the time and memory actually go, instead of guessing. A sampling profiler taps your program's shoulder thousands of times a second and asks what are you doing right now, cheap but a bit blurry. An instrumenting profiler wires a stopwatch into every single function, exact but slows everything down while it measures.
Real Talk
Profiling is the practice of measuring where a program spends CPU time, memory, or I/O during execution. Sampling profilers periodically capture the call stack with low overhead, producing statistical estimates suitable for production use, while instrumenting profilers insert timing code around every function call for exact measurements at the cost of significant runtime overhead.
When You'll Hear This
"Don't guess where it's slow, profile it first." / "The sampling profiler runs in production with basically no overhead."
Related Terms
Benchmarking
Benchmarking is timing your code to prove it's actually fast, and it is shockingly easy to do wrong.
Flame Graph
A flame graph is a picture of where your program actually spent its time, and it looks like a skyline made of stacked flames.
Heap Dump
A heap dump is a full snapshot of every single object living in your program's memory at one exact moment, frozen so you can poke through it later.
Perf Counters
Perf counters are the CPU's own built-in scorekeepers, tiny hardware registers that silently count things like cache misses, branch mispredictions, and ins...