Optimizing Rails template helper methods

Stefan Kaes is at it again with some interesting code to optimize Rails template helper methods. I have always wondered about some of the helper methods e.g. “< %= end_form_tag %>“. Why would you need that when it is easier to write “”?

Anyway, Stefan has shown that there is a cost to using many of the helper methods and that optimizing them may give you a performance increase. Methods involving routes are the worst performers.

By evaluating many of the methods only once (at template compile time) performance is increased. To see how your Rails application can be improved have a look at “Rails Template Optimizer Beta Test“.

No comments on this article yet. Why don't you go ahead and be first?

Leave a comment

OpenID

Anonymous

You can use some HTML elements. You know which they are.