← Docs

Recipe: Flame graph hotspot explainer

Turn a wall-clock flame graph into a plain-English summary of where your program spent its time — no profiler expertise required.

Ingredients

  • A collapsed-stack or folded-format flame graph file
  • Meridian CLI v2.3+ with the explain subcommand
  • Optional: source-map JSON for symbol resolution

Steps

  1. Collect stacks. Run your workload under perf record -g or equivalent. Convert to folded format with Brendan Gregg's stackcollapse script.
  2. Upload. Drop the collapsed file into the Meridian dashboard or pipe it directly:
    meridian explain --input stacks.folded
  3. Review hotspots. Meridian walks the call tree, merges identical frames, and ranks branches by cumulative CPU time. The top five hotspots appear in a ranked card list.
  4. Drill down. Click any hotspot to see its callee chain, self-time percentage, and a one-sentence explanation generated from the symbol name and context.
  5. Export. Copy the explanation as Markdown or share a permalink with your team.

Output example

Hotspot #1 — 34.2% CPU
Frame: inflate_fast (zlib)
Explanation: Decompression dominates; 34% of
samples land inside zlib's hot inner loop.
Consider pre-compressed assets or a faster codec.

This recipe is part of the Performance Recipes collection. For raw flame graph rendering, see the Flame Graph guide.