~/talk

Implementing Object Shapes in CRuby

Talkat Euruko 2022 · 2022-10-13..10-14· [ruby, compilers-and-language-design]
slides:none on file

Implements object shapes in CRuby and lands in Ruby 3.2 to replace per-class ivar maps with a shape tree keyed by shape ID, using 32-bit IDs on 64-bit platforms (~4.2B possible shapes) and 16-bit on 32-bit. Benchmarks show Railsbench uses ~10k shapes and Shopify monolith test suite hits 40,000 shapes. Changes remove undf prefill, eliminate fast-path frozen checks, improve JIT-generated code size, and produce microbenchmark wins including a notable 2× speedup on an inherited-ivar workload.

AI-written summary · about

  1. 0:00Ruby 3.2 features
  2. 1:52Object shapes in CRuby
  3. 9:41Implementing object shapes
  4. 16:03Benefits of object shapes
  5. 23:11Reducing code complexity
  6. 29:35Object shapes and JIT
  7. 31:00Performance improvements
  8. 33:26Summary
~/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.