~/talk

Building a Better OpenStruct

Talkat RubyConf 2016 · 2016-11-10..11-12· [ruby]
slides:none on file

Shows concrete fixes and fast alternatives: Ruby's OpenStruct is 10–40× slower than an explicit class and global method cache issues are fixed in Ruby 2.1. It demos profiling with stackprof and benchmark-ips and three implementations: OpenFastStruct (about 4× faster but changes nil semantics), PersistantOpenStruct (roughly 5× faster, defines methods once per class), and DynamicClass (about 8× faster than OpenStruct, 40% faster than PersistantOpenStruct, still ~3× slower than a hand‑written class). Benchmarks and code are available and the DynamicClass approach works.

AI-written summary · about

  1. 0:00Start
  2. 1:05OPENSTRUCT IS RUBY'S JAVASCRIPT OBJECT
  3. 5:13CONFIGURATION OBJECT
  4. 5:49TEST DOUBLE
  5. 7:38HOW DOES IT WORKS
  6. 11:20OPENSTRUCT IS SLOW
  7. 12:47METHOD LOOKUP IN RUBY
  8. 15:12HIERARCHICAL METHOD CACHE
  9. 32:41Dynamic Class
~/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.