Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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

Do all three template engines use automatic HTML escaping?



Yes, 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.


Slim defaults to ugly-mode: https://github.com/stonean/slim/blob/ae14457c596c963144810ce...

Haml uses pretty-mode in development and ugly-mode in production.


I 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


Here 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


My bad, sorry ... I'm going to change it on the Github page, but I can't edit it here, sorry.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: