Performance Analysis

How is a flame graph, used to present profiling results, read?

  1. AEach function's color indicates its importance
  2. BCall stacks are stacked vertically, and each function's width shows the share of time spent in it and its callees
  3. CThe horizontal axis shows the date the program ran
Show answer and explanation

Answer: B. Call stacks are stacked vertically, and each function's width shows the share of time spent in it and its callees

A flame graph stacks callers at the bottom and callees above, drawing each box with a width proportional to the number of samples recorded. Wider boxes use more time. A wide box with nothing on top means the function itself is spending the time, while functions stacked above show time spent in callees. It reveals at a glance which call paths are expensive.

  • A. Colors are usually just for distinguishing entries.
  • B. Correct. Wide parts are where time is spent.
  • C. The horizontal axis is time share, not date.