What Are Flame Graphs and How to Read Them - RubyConfBY 2017

What Are Flame Graphs and How to Read Them - RubyConfBY 2017

5a5fcbae333f071dc7a28f4958509db5?s=128

Miha Rekar

April 02, 2017
Tweet

Transcript

  1. ! @mr_foto

  2. " @mr_foto

  3. HOW YOU REMEMBER SLOVENIA

  4. HOW I REMEMBER BELARUS

  5. @mr_foto Software Developer Team Lead Git Blame Navigator Time Zone

    Resolver
  6. @mr_foto Software Developer Team Lead Git Blame Navigator Time Zone

    Resolver Slack Emoji Creator
  7. #

  8. None
  9. $FLAME GRAPHS$

  10. WHY AND WHAT Interactive visualization of stack traces From beginners

    to experts How SW is consuming CPU Brendan Gregg
  11. None
  12. None
  13. None
  14. None
  15. None
  16. SAMPLING My Day Reading Emails

  17. My Day Reading Emails Replying to Emails SAMPLING

  18. My Day Writing Code SAMPLING

  19. My Day Writing Code Writing Tests SAMPLING

  20. My Day Writing Code Writing Tests Running Tests SAMPLING

  21. My Day Writing Code Writing Tests Running Tests Fixing Tests

    SAMPLING
  22. My Day Writing Code Running Tests SAMPLING

  23. My Day Making Espresso SAMPLING

  24. SAMPLING My Day Reading Emails

  25. My Day Writing Code SAMPLING

  26. My Day Writing Code Running Tests SAMPLING

  27. My Day Reading Emails Replying to Emails SAMPLING

  28. GROUPING

  29. GROUPING

  30. GROUPING My Day Reading Emails Replying Writing Code ☕ Writing

    Tests Running Running Fix
  31. FLAME GRAPH Function

  32. FLAME GRAPH Function

  33. FLAME GRAPH Function

  34. FLAME GRAPH Stack Depth

  35. FLAME GRAPH Stack Depth

  36. FLAME GRAPH Stack Depth

  37. FLAME GRAPH Stack Depth

  38. FLAME GRAPH Ordered by Alphabet

  39. FLAME GRAPH Ordered by Alphabet

  40. FLAME GRAPH Total Time on CPU

  41. FLAME GRAPH Total Time on CPU

  42. FLAME GRAPH Total Time on CPU

  43. WHO WANTS A T-SHIRT?

  44. None
  45. Q&A Q: Which function is on CPU the most?

  46. Q&A A: f() top edge shows what is on CPU

    directly
  47. Q&A Q: Why is f() on CPU?

  48. Q&A A: a() → b() → c() → e() →

    f() f() was called by e(), e() was called by c(),…
  49. Q&A Q: How does b() compare to g()?

  50. Q&A A: b() looks like it is running (present) about

    10 times more often than g()
  51. USING WITH RUBY Sam Saffron gem 'flamegraph' Flamegraph.generate(filename) do #

    your work here end
  52. TOPTAL.BLOG

  53. ORIGINAL 1.083 (± 0.0%) i/s - 33.000 in 30.86s

  54. CACHE KRAMDOWN 8.368 (±12.0%) i/s - 244.000 in 30.04s

  55. CACHE KRAMDOWN 8.368 (±12.0%) i/s - 244.000 in 30.04s 7.5x

    improvement
  56. MEMOIZATION & CO. 10.140(± 9.9%) i/s - 292.000 in 30.03s

  57. MEMOIZATION & CO. 10.140(± 9.9%) i/s - 292.000 in 30.03s

    9.4x improvement
  58. NOW WHAT? You’re here Ask me Ask someone smarter than

    me Ask anyone else Read/watch blog posts/videos
  59. I ❤ ☕

  60. I ❤ ⌨

  61. I ❤ (

  62. I ❤ )

  63. http://mr.si/
 @mr_foto THANK YOU