Closed (fixed)
Project:
Subscriptions
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 May 2007 at 04:03 UTC
Updated:
1 Dec 2007 at 00:55 UTC
My site has been experiencing abnormal slowness, and I've tracked it to the subscriptions module.
According to this here, http://drupal.org/node/65801#comment-194285, when a module calls t() outside of a function, ie. in the global namespace, it causes severe performance degradation.
The offending lines on the current subscriptions.module are these:
define('SUBSCRIPTIONS_DEFAULT_SUBJECT', t('[!site] !type subscription update for !name : !subject'));
define('SUBSCRIPTIONS_DEFAULT_BODY', t("Greetings, !name.\n\nA !type to which you have subscribed has been updated.\n!title\n!teaser\nTo view the thread, navigate to !url \n\n--\nThis is an automatic message from !site.\nTo manage your subscriptions, browse to !manage-url"));Getting rid of the t() does the trick and gets rid of my performance problem, however a more complex solution needs to be found that allows for the two strings to get translated.
define('SUBSCRIPTIONS_DEFAULT_SUBJECT', '[!site] !type subscription update for !name : !subject');
define('SUBSCRIPTIONS_DEFAULT_BODY', "Greetings, !name.\n\nA !type to which you have subscribed has been updated.\n!title\n!teaser\nTo view the thread, navigate to !url \n\n--\nThis is an automatic message from !site.\nTo manage your subscriptions, browse to !manage-url");Any takers?
Comments
Comment #1
ricmadeira commentedUpdating this to 5.x-1.x-dev, where the same thing happens; maybe it will get more attention this way.
Did I mention this was severe? It really stops an entire site using locale.module dead in its tracks; instead of pages loading pretty much instantaneously they can take up to 20 seconds to load just because of these two t() calls. I got kicked out of my old webhosting service just because of this, before I had any idea what was happening. :(
Comment #2
csc4 commentedCan't seem to find this in the current subscriptions.module?
Comment #3
salvisRight, it was introduced in 1.62.2.44 and is in the current 5.x-1.x-dev (which this issue correctly refers to):
// $Id: subscriptions.module,v 1.62.2.45 2007/04/18 14:40:44 mindless Exp $(after the current release 5.x-1.9 / 1.62.2.38)
arthurf recently copied 1.62.2.38 back to HEAD (1.69), but HEAD is not a 5.x release. I don't know whether he intends to clip 1.62.2.39ff and make 5.x-1.x-dev obsolete. We don't really know where we stand right now (see http://drupal.org/node/139533#comment-270604).
Comment #4
bdragon commented5.x-2.0 version is a complete rewrite, any bugs in it are new, all prior versions becoming unsupported, closing for that reason. (There's no way this particular issue survived the rewrite.)