~/talk

Don't @ me! Faster Instance Variables with Object Shapes

Talkat RubyConf 2022 · 2022-11-29..12-01· [ruby]
slides:none on file

Claims concrete speedups: using Object Shapes (shape IDs stored in object headers) plus inline caches and JIT integration reduces instance-variable read cost from about 2.7× faster on the VM to ~5.4× under JIT, makes IV writes about 21% faster, and cuts class-related memory use (John Hawthorne reports ~16 MB saved). Implementation treats undefined IVs via Q on Def, encodes frozen/extended state as shape transitions, and ships alongside Ruby 3.2 and YJIT work.

AI-written summary · about

  1. 0:00Start
  2. 5:23Hash based implementation
  3. 5:53Tree Walking Interpreter
  4. 13:05Cache Lookup Problem
  5. 15:10Handling "Undefined" Instance Variables
  6. 17:05Conditionals for Reading an IV
  7. 17:50Machine Code for Reading an IV
  8. 18:51Shape Transitions on Write
  9. 23:20Freezing Changes Shape
  10. 28:13Machine Code for reading one IV
  11. 33:01Benchmark Comparison
~/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.