Skip to main content

Understanding icicle and flame graphs

Icicle and flame graphs are essential visualization tools for analyzing performance data in various systems, like computer software, database systems, and web services. These graphs visually represent a system's performance, making it easier to identify bottlenecks and optimize resource usage.

This document will guide you through understanding and interpreting icicle and flame graphs to improve your system's performance.

To learn more about mechanics of icicle and flame graphs, check out the Anatomy of icicle and flame graphs page.

Let's take a look at how to interpret icicle and flame graphs.

Here's a quick summary of how to interpret icicle graphs:

  1. Each rectangle represents a function call in the stack.
  2. The y-axis shows stack depth (number of frames on the stack). The bottom rectangle shows the function that was consuming cumulatively the most resource. Everything above represents ancestry. The function above a function is its parent.
  3. The x-axis spans the samples. It does not show the passing of time, as most of the time-series graphs do. It's sorted alphabetically to maximize merging.
  4. The width of the rectangle shows the total resource usage. Functions with wide rectangles may consume more resource per execution than narrow rectangles, or, they may simply be called more often.
The colors do not represent anything significant.

This visualization was called an "icicle graph", it looks like icicles. They are usually picked at random to be cold colors (other meaningful palettes are supported).

explained.svg

Let's take a look at an example profile.

interpretation01.svg

The graph is a tree. The root of the tree is the function that was consuming the most resource. But it's cumulative. It's the sum of all the resources consumed by the function and its children.

interpretation02.svg

The bottom edge of the graph shows the function that was solely consuming the mostly resource.

In this case, they are d, f, and c.

interpretation02.svg

The vertical axis shows the stack depth.

For example, one of the leaf is f function. The function above it is f's parent, which is f's caller. In this case, it's e. The function above e is b, and so on.

interpretation03.svg

We can visually compare the length of the rectangles to see which function is consuming more resources.

For example, in this case, b is consuming more resources than c.

interpretation04.svg

The horizontal axis shows the samples.

It does not show the passing of time, as most of the time-series graphs do.

interpretation05.svg

Real-life Examples

https://demo.parca.dev/

Parca - All

https://demo.parca.dev/

Parca - Kubelet

Sources