On 3/8/07, Mohit Sindhwani <mo_mail / onghu.com> wrote:
> Jeremy Kemper wrote:
> > Excerpted results on a new MacBook Pro:
> >                           user     system      total        real
> > raw quoted            0.460000   0.000000   0.460000 (  0.480184)
> > create                2.760000   0.080000   2.840000 (  3.225227)
> >
> Hi, are these results in production or development?

There is no difference between the two in this case, so the script
doesn't set RAILS_ENV at all.


> Talking about template rendering, I'm just wondering if anyone has
> thought of pre-processing the template for a production environment.
> For example, I'd imagine it's might convenient to do things like '<%
> tylesheet_tag %>' etc when linking in files.  But, each time Rails hits
> one of those, it needs to render it.  Would it make sense to have a
> smart pre-processor that goes through the templates to see what
> constants there are (like links to the same stylesheet, javascript
> files, etc.) and even things like "form_start_tag"/ "form_end_tag" etc.
> to pre-render it so that the number of times you need to create
> something is reduced.

Yes! See Stefan Kaes' template optimizer: http://railsexpress.de/plugins/trac


> Has anyone benchmarked the time for rendering a page with many or few
> such items?

Yes. See Stefan's blog; he regularly benchmarks his apps against each
new Rails release. I think he's covered the impact of the template
optimizer.

jeremy