~/talk

Eliminating Unnecessary Implicit Allocations

Talkat RubyKaigi 2025 · 2025-04-16..04-18· [ruby]
slides:none on file

Ruby 3.4 eliminates several unnecessary implicit allocations: it fixes 3 allocation regressions found in ~2 weeks, adds an allocation test suite that prevents future regressions, and changes the VM to use new instructions (e.g., push_to_array and push_to_array_keyword_splat) so literal arrays and splatted calls now usually allocate a single array or no hash. Compiler changes move splat-dup logic into parse-time, fixing many caller-side splat allocations while preserving evaluation order.

AI-written summary · about

  1. 0:00Introduction
  2. 0:29Allocation regressions overview
  3. 1:56First allocation regression fix
  4. 2:39Second allocation regression fix
  5. 3:01Third allocation regression fix
  6. 4:04Allocation test suite creation
  7. 6:11Literal arrays optimization
  8. 9:00Large literal arrays issue
  9. 10:43Literal arrays with splats
  10. 12:24Keyword splats in arrays
  11. 13:25Caller-side splat allocations
  12. 18:43Args cat node optimization
  13. 20:29Safe splat allocation checks
  14. 25:44Evaluation order issue
  15. 28:32Unfixable implicit allocations
  16. 29:57Call-side implicit allocations
  17. 30:17Conclusion and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.