Profiling
Profiling samples a program's runtime resource usage (CPU/memory/IO), locating hot functions and bottlenecks to guide optimization.
Purpose
Locate performance bottlenecks with data, avoiding guess-based optimization.
Mechanism
CPU profile: samples call stacks to find time-consuming functions. Heap profile: memory allocation hotspots. Flame graphs visualize stack time. Node --prof, Python cProfile, Java JFR. Production sampling minimizes overhead.
Use cases
- Performance optimization
- Bottleneck identification
- Flame graphs
Related terms
Flame Graph
A flame graph visualizes sampled call stacks as flames: the x-axis width of a stack frame equals its time share, the y-axis equals call depth, revealing hotspots. GLOSSARY
Just-In-Time Compilation
JIT compiles hot code to machine code at runtime, combining the flexibility of an interpreter with the performance of a compiler. GLOSSARY