4 ms·
It's called Haml and Slim, not HAML and SLIM. Are you running the server in production mode? Slim already has a set of benchmarks that compares it to Haml and
by judofyr 14y ago
It's called Haml and Slim, not HAML and SLIM.
Are you running the server in production mode?
Slim already has a set of benchmarks that compares it to Haml and ERB in various settings: https://github.com/stonean/slim#benchmarks https://github.com/stonean/slim#benchmarks
Do all three template engines use automatic HTML escaping?
- urbanautomaton 14y agoYes, some configuration detail would be helpful. For instance, I can't find any custom Haml config, suggesting it's running with the defaults - in production mode this would mean that the output HTML is indented, while it wouldn't be in development or test. This has a noticeable performance effect, and it looks as though the same is true of Slim.
- judofyr 14y agoSlim defaults to ugly-mode: https://github.com/stonean/slim/blob/ae14457c596c963144810ced65ac9c275498bffd/lib/slim/engine.rb#L8 https://github.com/stonean/slim/blob/ae14457c596c963144810ce... Haml uses pretty-mode in development and ugly-mode in production.
- klaustopher 14y agoI was going with the defaults, and I was running it in development mode ... An issue on the page already pointed out, that the comparison to Slims ugly mode isn't really that fair. But I just went with the out-of-the-box config, as do most Haml projects I've come across
- klaustopher 14y agoMy bad, sorry ... I'm going to change it on the Github page, but I can't edit it here, sorry.
- theandym 14y agoHere are my results running it in production mode (RAILS_ENV=production rails server >/dev/null 2>/dev/null): ERB: 9.619 seconds Haml: 10.893 seconds Slim: 10.195 seconds Full details at https://gist.github.com/3906297 https://gist.github.com/3906297