~/talk

The Anatomy of an ERB Rendering Engine

Talkat RubyConf 2026 · 2026-07-14..07-16· [ruby]
slides:none on file

ERB is a tiny compiler that turns templates into Ruby source; classic engines like erb and erubi scan and emit fast string-appends. A syntax-tree approach with Herb::Engine parses HTML and Ruby (uses Prism), trading ~21 µs vs 424 µs compile time (≈20× slower compile) for identical ~1.14 µs render speed and new capabilities: precise diagnostics, a registry of ~250 Rails helpers enabling static evaluation (3–100× faster on helper-heavy fragments), live partial updates in the dev server, and groundwork for fine-grained reactivity.

AI-written summary · about

  1. 0:00ERB rendering engines intro
  2. 2:57ERB as Ruby generator
  3. 7:36ERB engine anatomy
  4. 11:47String-splitting ERB limits
  5. 13:12Herb parsing approach
  6. 16:44Compile time vs ERB
  7. 18:54Runtime performance
  8. 20:21Optimization domain
  9. 23:49Diagnostics and tooling
  10. 25:37Live reloading with Herb
  11. 26:42Reactive Action View vision
  12. 28:48ERB vs Herb engines
  13. 30:13Template engines future
~/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.