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
explainsubcommand - Optional: source-map JSON for symbol resolution
Steps
- Collect stacks. Run your workload under
perf record -gor equivalent. Convert to folded format with Brendan Gregg's stackcollapse script. - Upload. Drop the collapsed file into the Meridian dashboard or pipe it directly:
meridian explain --input stacks.folded
- 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.
- 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.
- 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.