Hi Steve,
We had (and still have) something similar, all views are consistently
relatively "slow", though not near as slow as you're reporting, more
like 300ms (Views: 270ms | ActiveRecord: 10ms).
After loads of profiling we've still got no satisfactory explanation
other than that the hundreds / thousands calls to +concat+ and/or
+haml_concat+ just adds up. Lots of String concatenation (as done by ERB
and Haml) to build a view before it's send over the wire is not as
efficient as it could be. Let's see what the 3.1 plan brings:
http://yehudakatz.com/2010/09/07/automatic-flushing-the-rails-3-1-plan/
Also, if you're doing i18n stuff, make sure you're got at least
I18n::Backend::Cache included in your i18n backend, those I18n.t methods
are dog slow and are easily hit hundreds of times per page (in our case
at least).
Greets,
Lawrence
I think this has come up on Roro before (by someone at Envato?) but I
can't find it through search.
I'm finding that views are becoming by far the slowest part of my app,
eg for a reasonably complex page:
Completed 200 OK in 841ms (Views: 657.3ms | ActiveRecord: 27.5ms)
Or for a more complex one:
Completed 200 OK in 4093ms (Views: 3968.6ms | ActiveRecord: 115.3ms)
This is for Rails 3 in the default production environment, which I
understand uses Erubis for view rendering. Is there any way to speed
this up? Different template engine? Other tricks?
--
You received this message because you are subscribed to the Google Groups "Ruby or
Rails Oceania" group.
To post to this group, send email to rails-ocea...@googlegroups.com.
To unsubscribe from this group, send email to
rails-oceania+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rails-oceania?hl=en.