High Performance Template Engine: Guide to optimize your Ruby code
summary
Built two faster Haml engines, Faml and Hamlit, by measuring with benchmark-ips and profiling with stackprof / rblineprof; attribute handling is classified into static, dynamic, and runtime so static HTML can be emitted at compile time. Hot paths get rewritten as C extensions, giving roughly 2x rendering speed in Faml and up to ~18x faster compile-time behavior for Hamlit on some benchmarks after removing expensive features (data-attr hyphenation, boolean attr handling).
AI-written summary · about
chapters (7)
- 0:00Introduction
- 4:44Optimizing Ruby code
- 7:51Profiling and benchmarking
- 10:02Creating Faml template engine
- 18:53Building Hamlitt
- 24:29Removing unnecessary features
- 31:04Conclusion and Q&A








