Hi,
In project_release.module it has a t() called outside of a function. This is a problem for any site using locale translations since global $locale is not defined yet, thus it has to rebuild the locale cache on _every_ pageload for any authenticated user. This can be quite large. On http://labs.divx.com/ this patch resulted in a 50% decrease of page load time.
For more background, see the following posts:
http://pajamadesign.com/2008/06/29/the-t-that-took-down-a-webserver/
http://drupal.org/node/253813
Thanks,
Steve
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 286430_project_release_t_1.patch | 2.51 KB | aclight |
| project_release.module-0.patch | 2.21 KB | slantview |
Comments
Comment #1
aclight commentedHere's an updated patch that applies correctly without fuzz. The actual code changes are no different in this patch.
On a simple test installation with the locale module enabled, and using a new language I created which contains 1 translated string, before the patch I was consistently getting page load times of ~240 ms for a particular page. After applying the patch, the load time went down to ~200 ms, which is about the same amount of time the page took to load with the locale module turned off. So while this is far from a 50% decrease in page load time, it is a significant decrease.
Comment #2
dwwAdded a comment explaining what was going on, and committed to HEAD and DRUPAL-5. Thanks, all.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.