logoalt Hacker News

anonygler04/02/20251 replyview on HN

I used a rendering library like Phlex back in 2010. I hated it back then and I still don’t like it.

They claim it’s faster than ERB but only show micro benchmarks. This is basically a form of lying.

This approach stinks for a lot of reasons:

- it adds a ton of pressure on the garbage collector. - the backtraces suck to debug. Ruby is better now than in 2010, but it’s still lame. - your templates are largely static. Yet when it lives as code you can’t cache any of it. An efficient ERB generator is just cached strings concatenations. Very efficient in Ruby.

Finally, Rubyists hate this and it’s why the community is slowly dying. Almost all your frontend should be in JS/JSX at this point. Even the static stuff.


Replies

joeldrapper04/02/2025

This is nonsense. You can cache it like anything else. But you probably won’t need to because it’s so fast.