Performance killer : t-function called in global scope
quaoar - December 3, 2008 - 11:58
| Project: | UC Discounts |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs review |
Description
On line 14 and 15 in the uc_discounts.module, we find these two lines:
define('UC_DISCOUNTS_YES', t('yes'));
define('UC_DISCOUNTS_NO', t('no'));
This is really bad for performance.
Calling t() in globale scope forces a call to locale_refresh_cache for every page view.
We have just changed it to this for now:
define('UC_DISCOUNTS_YES', 'yes');
define('UC_DISCOUNTS_NO', 'no');

#1
this is something very bad, plese fix it
#2