Reducing Implicit Allocations During Method Calling
summary
Shows concrete allocation cuts in Ruby 3.3 and 3.4: a call that was allocating four arrays and one hash in Ruby 3.2 becomes allocationless in 3.3 after keyword splat separation and changing Splat_array true to Splat_array false. Adds optimizer-level checks, a caller flag ARG_SPLAT_MUTE, and new VM ops like concat_2_array, push_to_array and Splat_keyword so multiple splats, splat+arg and anonymous-splat forwarding drop redundant allocations and preserve correct evaluation order.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:09Measuring implicit allocations
- 3:38Keyword Splat separation
- 11:26Splat array optimizations
- 17:49Ruby 3.4 optimizations
- 24:06Anonymous Splat forwarding
- 27:56Generic argument forwarding
- 29:01Bugs and lessons learned
- 29:44Closing and Q&A
related talks
39mPointers for Eliminating Heaps of Memory
27mNew Ruby 2.1 Awesomeness: Pro Object Allocation Tracing
28mSplitting: the Crucial Optimization for Ruby Blocks
34mHow to optimize Ruby internal.
45mClosing Keynote: Analyzing and Reducing Ruby Memory Usage
04mLightning Talk: Smooshing Ruby
27mOptimizing Ruby's Memory Layout
29mTidying Active Record Allocations
