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

Comments

aclight’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.51 KB

Here'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.

dww’s picture

Priority: Critical » Normal
Status: Reviewed & tested by the community » Fixed

Added a comment explaining what was going on, and committed to HEAD and DRUPAL-5. Thanks, all.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.