J
Jeremy Kemper
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