A performance mystery can be misleading: a function that looks hot may be doing legitimate work, suffering deoptimization, or being interrupted by garbage collection. A flame graph visualizes sampled call-stack activity so those possibilities can be investigated rather than guessed. section 11.1.6
Read the chart by separating stack position from time:
- Each horizontal bar represents a function on the call stack. section 11.1.6
- Bar width represents relative time on the stack; wide bars account for more samples. section 11.1.6
- Vertical position represents call depth: callers appear above callees. section 11.1.6
- Use bottom-up analysis to find hot self-time, then the call tree to identify the path reaching it. section 11.1.6
Runtime-dependent hotspots
A TextEncoder benchmark inverted its apparent bottleneck across runtimes: buildDeepConsString consumed about 40% of Node.js samples while encode consumed 26%; on Bun, encode consumed 67% and buildDeepConsString 9%. section 11.1.6




