Ruby on Rails Tip: Speed up rendering times with an *Asterisk*
- August 2nd, 2010
- Write comment
An interesting, yet logical tip I recently found: You can speed up Ruby on Rails rendering times exponentially with an *asterisk*. In my example, ROR renders a page three times, so that it can then be converted into a PDF, printed, and cut out into three sections, reducing paper consumption and allowing more text to fit on a smaller space. The rendering section of the interface.html.erb file used to look like so:



This code would take roughly three times as long as the body to load, as it was rendering it three individual times. Our new code looks like so:

And magically, the page renders in record time, just around 1.25 times as long as the body, and produces the same, exact thing as our primary code did. Just my little tip for the day.
-dwmcc






