August 15, 2006

Posted by John

Tagged optimization, templates, and views

Older: Active Record Dynamic Finders

Newer: memcached Intro

Stefan Kaes Template Optimizer

Stefan of RailsExpress has just released his new template optimizer (trac available here). The data set that he shows at the end of the post look pretty impressive. I can’t wait to try this. So how does it work? Glad you asked.

Whenever the code for a Rails template gets compiled, the Rails Template Optimizer gets invoked in the context of the current controller’s view class, with the name of the compiled render method. It then retrieves the abstract syntax tree of the render method, processes it according to a set of configured optimization options, creates Ruby source code from the transformed tree and evaluates the new source to obtain an optimized version of the original method.

0 Comments

Thoughts? Do Tell...


textile enabled, preview above, please be nice
use <pre><code class="ruby"></code></pre> for code blocks

About

Authored by John Nunemaker (Noo-neh-maker), a web developer and programmer who has fallen deeply in love with Ruby. More about John.

Syndication

Feed IconRailsTips Articles - An assortment of howto's and thoughts on Ruby and Rails.

Feed IconRails Quick Tips - Ruby and Rails related links.