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.
Practice this topic Back to topic

More Performance Analysis questions

  1. Which is an example of what CPU performance counters (the PMU) can count?
  2. Performance counters show a program's IPC is very low at 0.3, with many last-level cache misses. Which pairs the likely situation with a remedy?
  3. Performance counters reveal very frequent branch mispredictions. Which is a suitable remedy?
  4. In top-down microarchitecture analysis using performance counters, which are the major categories into which CPU issue slots are divided?
  5. A program is slow, yet CPU utilization is only about 20%. What is the most likely cause?