~/talk

Implementing Object Shapes for CRuby

Talkat RubyConf AU 2023 · 2023-02-16..02-17· [ruby]
slides:none on file

Ruby 3.2 ships a concrete implementation of Object Shapes in CRuby that replaces class‑caching with shape IDs, encodes frozen status, capacity and size pool, removes undef fills on allocation, and moves ivar indices to shape edges. Microbenchmarks and yjit codegen show it works: some ivar get/set microbenchmarks are several percent faster and yjit shows about a 45% speedup on ivar gets (yjit goes from ~3.37x to ~5.42x interpreter speed). An ObjectSpace.dump_shapes JSON API exposes the shape tree.

AI-written summary · about

  1. 0:00Object shapes in Ruby
  2. 2:29Ruby 3.2 Christmas release
  3. 3:52What this talk will cover
  4. 4:54Instance variables in Ruby 3.1
  5. 9:31What object shapes are
  6. 14:05Implementing object shapes
  7. 17:16Performance gains
  8. 19:22Code complexity reduction
  9. 26:16Object shapes for JIT
  10. 31:34Object shapes Q&A
  11. 33:41Inspecting object shapes
~/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.