~/talk

Building a Better OpenStruct

Talkat WindyCityRails 2016 · 2016-09-15..09-16· [ruby]
slides:none on file

OpenStruct’s beautiful API hides a big cost: typical use runs 10–40× slower than an explicit class. Several fixes are explored: open_fast_struct avoids upfront method defs and runs ~4× faster but breaks code by returning truthy placeholder objects; a persistent openstruct defines methods on the class (≈5× faster, ~10% app speedup) and Ruby 2.3’s lazy-member change removes eager defs; a custom dynamic class hits ~8× faster than OpenStruct and narrows the gap to about 3× slower than a hand-written class.

AI-written summary · about

  1. 0:00Introduction
  2. 1:47What is OpenStruct
  3. 5:19How OpenStruct works
  4. 10:11Why OpenStruct is slow
  5. 12:56Can we build better
  6. 13:17Round one OpenFastStruct
  7. 16:24OpenFastStruct problems
  8. 18:09Round two PersistentOpenStruct
  9. 22:01Round three OpenStruct improvements
  10. 23:05Round four DynamicClass
  11. 26:55Lessons learned
  12. 29:03Conclusion
~/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.