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

Flame Graphs

Flame Graphs

Talk I gave at Slovenia Ruby User Group meetup in May '16. What are flame graphs, how to read them, simple tutorial, practical example.

Further read:
- The Flame Graph: http://queue.acm.org/detail.cfm?id=2927301
- flamegraph gem: https://github.com/SamSaffron/flamegraph
- rack-mini-profiler: https://github.com/MiniProfiler/rack-mini-profiler
- ruby-prof-flamegraph: https://github.com/oozou/ruby-prof-flamegraph

Miha Rekar

May 26, 2016
Tweet

More Decks by Miha Rekar

Other Decks in Technology

Transcript

  1. WHY AND WHAT • How SW is consuming CPU •

    DTrace is verbose and unreadable • Brendan Gregg • combine stack traces with common paths
  2. FLAME GRAPHS EXPLAINED • each box represents a function (a

    merged stack frame) • y-axis (vertical) shows stack depth • top function led directly to the profiling event • everything beneath it is ancestry (explains why) • x-axis (horizontal) shows the sample sorted alphabetically • box width shows the total time it was on-CPU
  3. TUTORIAL A: a() → b() → c() → e() →

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

    choose the b() path
 c() choose the e() path look for branches
  5. FURTHER READ • The Flame Graph: http://queue.acm.org/ detail.cfm?id=2927301 • flamegraph

    gem: https://github.com/SamSaffron/ flamegraph • rack-mini-profiler: https://github.com/ MiniProfiler/rack-mini-profiler • ruby-prof-flamegraph: https://github.com/oozou/ ruby-prof-flamegraph