Who You Gonna Call: Analyzing the Run-time Call-Site Behavior of Ruby Applications
summary
Analysis covers 74 benchmarks and finds call sites are overwhelmingly monomorphic (about 98% monomorphic), yet 40–60% of caches contain duplicate entries. TruffleRuby-style splitting collapses polymorphism effectively but often produces identical cloned caches — up to ~60% in a benchmark — wasting memory and adding runtime cost. Call-site behavior follows three patterns (initialization, phased shifts, mirroring) and blocks are measurably more polymorphic than methods (e.g., least-polymorphic blocks ~2.1% vs methods <1%). Proposal: context-driven splitting guided by argument types to avoid unnecessary clones.
AI-written summary · about
chapters (10)
- 0:00Ruby call-site behavior
- 1:28Call-site assumptions
- 3:16Call-site optimizations
- 4:21Splitting optimization
- 8:57Over-splitting and cache
- 12:26Runtime stability
- 16:43Polymorphic call sites
- 19:36Methods vs blocks
- 21:22Key findings
- 22:58Q&A
related talks
52mHow Are Method Calls Formed?
49mHow are Method Calls Formed?
28mSplitting: the Crucial Optimization for Ruby Blocks
30mFast Metaprogramming with Truffle
51mOpening Day 3 Keynote
38mRuby Unblocked
43mParallel and Thread-Safe Ruby at High-Speed with TruffleRuby
24mRuby Performance Secrets and How to Uncover Them
