FlameGraph
Stack trace visualizer
FlameGraph turns raw CPU profiler output into an interactive SVG chart where the widest boxes show which functions consume the most time, making it fast to spot performance bottlenecks in any program.
FlameGraph is a tool that turns raw performance profiling data into a visual chart — called a flame graph — that makes it instantly clear where a program is spending most of its time. The problem it solves is performance diagnosis: when a program is slow, developers need to know which function calls are eating CPU time, but raw profiler output is a wall of numbers that is very hard to read. A flame graph stacks those function calls visually so that the widest boxes at the top are the biggest time consumers.
The process has three steps. First, you capture stack samples from your running program using a profiler like Linux perf, DTrace, or SystemTap — tools that periodically snapshot what the CPU is doing. Second, a "stackcollapse" script reformats those raw samples into a tidy text format. Third, the main flamegraph.pl script takes that text and renders an interactive SVG image you can open in a browser, zoom into by clicking, and search with Ctrl-F to find specific functions.
You would reach for this tool when a production service is slow and you need to find the root cause quickly, or when optimizing code and you want proof of which areas are worth improving. It supports profiling data from Linux perf, DTrace, SystemTap, Java, Go, Instruments, VTune, and more. The core script is written in Perl.
Where it fits
- Profile a slow production service with Linux perf, then generate a flame graph to pinpoint exactly which functions are the CPU bottleneck.
- Optimize a Go or Java application by visualizing call stacks and clicking into the widest bars that represent the most time-consuming code paths.
- Share an interactive SVG flame graph with a colleague so they can zoom in and search for specific functions in a browser without installing any tools.