SMRTR ProgrammingSep 9, 2025Lobsters

How I Made Ruby Faster than Ruby

SMRTR summary

P2, a Ruby HTML templating library, transforms templates into optimized code that's never actually executed. Through key improvements to the code generation process—separating static and dynamic HTML, removing rescue clauses, freezing string literals, and using faster HTML escaping—P2 now matches ERB/ERubi performance while being 10x faster than non-compiled alternatives like Papercraft. This compilation approach demonstrates that Ruby can be extremely fast when code is properly optimized.

SMRTR provides this summary for quick context. The original article belongs to Lobsters.

Read the original article
SMRTR Programming

Get the next batch of curated stories in your inbox.

This archive is built from SMRTR newsletter stories. Subscribe for hand-picked stories without the extra noise.

Related Stories

Browse Programming
ProgrammingAug 23, 2026

Rust Glancer

Rust-analyzer's memory bloat stems from treating all 6,666 dependencies equally — a tiered, IntelliJ-style backend could fix that.