~/talk

The View is Clear From Here

Talkat TraversalConf 2019 · on Thursday, 2019-03-28· [ruby-on-rails]
slides:none on file

Rails Action View templates compile into methods so the team measures compiled method sizes (≈1,200 bytes) and shows performance improvements: naive ERB renders ~27k/sec, caching the compiled source ~63k/sec, and turning templates into real methods hits 1.4 million renders/sec (≈52× faster). Caching partial-collection keys can backfire — a microbenchmark finds caching can be 5.6× slower than no-cache when key computation dominates. Practical fixes: forbid instance vars in views, pass view objects as locals, and use a same-format assumption to precompute fast, predictable render targets.

AI-written summary · about

  1. 0:00Start
  2. 9:59ERB Template
  3. 10:21ERB Compiler
  4. 11:14Modified Compile Script
  5. 11:27Compiler Output
  6. 11:43ERB Translations
  7. 12:10Capturing Blocks
  8. 12:29What is the output?
  9. 12:40Compiled Source
  10. 14:09Different ERB Flavors
  11. 15:09Rendering Speed
  12. 15:28Cache Compilation
  13. 16:28Define a Method
  14. 17:21Method Generation
  15. 18:14Rails Template Methods
  16. 18:47Memory Size
  17. 19:44Instance Variable Visibility
  18. 24:25Too Many Compilations
  19. 27:11Users Controller Controller
  20. 27:36Template Source
  21. 28:22Template Cache Keys
  22. 29:18Template Contents
  23. 29:42Requests and Rendering
  24. 30:34respond_to Controller
  25. 31:09Context Dependent
  26. 34:37Three Templates
  27. 36:20Profiled The Cache
  28. 37:11Benchmark Results
  29. 37:55Same Format Assumption
  30. 38:43Ambiguous Render Problem
~/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.