~/talk

Optimizing Partial Backtraces in Ruby 3

Talkat RubyConf 2021 · 2021-11-08..11-10· [ruby]
slides:none on file

Backtrace generation in Ruby 3 changes from scanning outward to scanning inward, producing partial backtraces far faster by avoiding work on irrelevant control frames — an initial patch speeds some cases to about 6× faster for deep (~400 frame) stacks but introduces a missed frames bug fixed in 3.0.1. A new algorithm that scans from the most recent frame is simpler, about twice as fast than the optimized inward approach, and lands for broader use.

AI-written summary · about

  1. 0:00Backtrace optimization intro
  2. 2:08What backtraces are
  3. 4:52Ruby VM control frames
  4. 5:33Ruby 2.7 backtraces
  5. 9:42Partial backtrace slowdown
  6. 10:02Optimizing in Ruby 3
  7. 12:06First bug in algorithm
  8. 13:30Second regression
  9. 16:57Optimization limits
  10. 17:19New backtrace design
  11. 20:47Advantages of new design
  12. 21:29Ruby 3.1 bugs
  13. 22:33Backporting Ruby 3.0 fixes
  14. 25:43Ruby 3.0.3 fixes
  15. 26:04Optimization lessons
  16. 27:10Closing and book promo
  17. 27:38Q&A on backtraces
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.