~/talk

Splitting: the Crucial Optimization for Ruby Blocks

Talkat RubyConf 2022 · 2022-11-29..12-01· [ruby]
slides:none on file

Explains that splitting makes multiple, caller-specialized copies of a method so the JIT can compile method+block together, enabling aggressive inlining and constant folding. Demonstrates on a numeric step example, implemented on Truffle/TruffleRuby, removing polymorphism and turning branchy Ruby loops into C‑like tight loops. Reports concrete results: 7.7× speedup on the microbenchmark and claims up to 100× vs CRuby in one case, with memory growth controlled by limits.

AI-written summary · about

  1. 0:00Splitting optimization intro
  2. 1:25Splitting in Self language
  3. 3:29Sum_to method example
  4. 4:30JIT inlining challenges
  5. 7:17Numeric step complexity
  6. 9:21Polymorphic block problem
  7. 10:46Splitting resolves polymorphism
  8. 12:11Splitting optimization benefits
  9. 12:32Monomorphic vs megamorphic
  10. 13:34Recursive splitting for nesting
  11. 15:37Profiling and type specialization
  12. 18:45Optimized step method
  13. 19:48Performance vs C
  14. 20:50Benchmarking splitting impact
  15. 21:53Optcarrot and Rails gains
  16. 22:56TruffleRuby speedup
  17. 23:18Polymorphism research
  18. 25:04Conclusion and future
  19. 26:11Q&A: Memory trade-offs
~/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.