Performance issue in bogo_languages() function (2 posts)

  1. Rulatir
    Posted 2 years ago #

    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.


  2. Takayuki Miyoshi
    Plugin Author

    Posted 2 years ago #

    You're right. Thank you for the good suggestion.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Bogo
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic