~/talk

Improving CVAR performance in Ruby 3.1

Talkat RubyConf 2021 · 2021-11-08..11-10· [ruby]
slides:none on file

Announces a concrete change: Ruby 3.1 adds a class variable cache implemented as an inline cache stored on the topmost class that tracks global_cvar_state and skips repeated ancestor walks. Microbenchmarks show class variable access was 8.5× slower with 100 modules vs one, and railbench yields +42 RPS (about 6–7% faster, 615 → 657 RPS). The cache eliminates progressive slowdown and shows real-world speedup without code changes.

AI-written summary · about

  1. 0:00Start
  2. 2:59Class Variables
  3. 3:40Class Instance Variables
  4. 6:45Class Variables and Instance Variables Are Stored in the Same Hash Table Structure in Ruby
  5. 8:58Benchmarks
  6. 15:50Railsbench
  7. 24:34Learn C
  8. 25:08How Ruby Is Designed
  9. 25:29Contributing to Ruby
~/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.