Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What Are Flame Graphs and How To Read Them

Miha Rekar
December 22, 2014

What Are Flame Graphs and How To Read Them

Short tech talk I did for my coworkers on flame graphs.

Further read:
- Blazing Performance with Flame Graphs (video): https://www.usenix.org/conference/lisa13/technical-sessions/plenary/gregg
- FlameGraph: https://github.com/brendangregg/FlameGraph
- ruby-prof: https://github.com/ruby-prof/ruby-prof
- ruby-prof-flamegraph: https://github.com/oozou/ruby-prof-flamegraph

Miha Rekar

December 22, 2014
Tweet

More Decks by Miha Rekar

Other Decks in Programming

Transcript

  1. DEFINITION • each box represents a function (a merged stack

    frame) • y-axis shows stack depth • top function led directly to the profiling event • everything beneath it is ancestry (explains why) • x-axis spans the sample population, sorted alphabetically • box width is proportional to the total time a function was profiled directly or its children were profiled • all threads can be shown in the same Flame Graph (the default), or as separate per-thread Flame Graphs • flame graphs can be interactive: mouse over for details
  2. LOOKS • Flame Graphs sort stacks alphabetically • from the

    bottom frame upwards • increases merging and visualizes code paths
  3. EXAMPLE A: a() → b() → c() → e() →

    f() f() was called by e(), e() was called by c(),…
  4. EXAMPLE A: code path branches can reveal key functions:
 a()

    choose the b() path
 c() choose the e() path look for branches