Skip to content
uencoder

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

References