Performance issue in bogo_languages() function
There is a performance issue in bogo_languages() function. The $langauges array is recreated on every call to bogo_languages(), resulting in 61 calls to __() – one for each language name. bogo_languages() is in turn called 70 times during a request for “/” (on my machine, but a cursory glance at the code suggest that the exact number depends on the number of installed locales). This results in 61*70 = 4270 calls to translate(), and the performance hit is noticeable.
Please consider caching the $languages array in a global variable.
- The topic ‘Performance issue in bogo_languages() function’ is closed to new replies.