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

What Are Flame Graphs and How to Read Them - DevConTLV X

Miha Rekar
November 15, 2016

What Are Flame Graphs and How to Read Them - DevConTLV X

A talk I gave at DevConTLV X in November 2016

https://www.youtube.com/watch?v=lIo0cEhT-Js

Further read:
- The Flame Graph: http://queue.acm.org/detail.cfm?id=2927301
- Blazing Performance with Flame Graphs (video): https://www.usenix.org/conference/lisa13/technical-sessions/plenary/gregg
- 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

November 15, 2016
Tweet

More Decks by Miha Rekar

Other Decks in Technology

Transcript

  1. WHOIS @mr_foto # Software Developer $ Ruby Slovenia organizer %

    Long Distance Runner & Event Photographer ☕ Coffee Connoisseur ⌨ Keyboard Enthusiast ) Special
  2. WHY AND WHAT • Interactive visualization of stack traces •

    From beginners to experts • Can be used for many things • How SW is consuming CPU • Brendan Gregg
  3. 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
  4. SAMPLING • Time interval • Observe what’s going on •

    Which action caused current action • Real-world example
  5. Q&A A: a() → b() → c() → e() →

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

    choose the b() path
 c() choose the e() path look for branches
  7. NOW WHAT? • You’re here • Ask me • Ask

    someone smarter than me • Ask anyone else • Read/watch blog posts/videos