WordPress Performance Analysis Finds Translations May Significantly Slow Down Sites

After a recent in-depth performance analysis earlier this year showed that translations can have an impact on server response times, WordPress contributors are proposing half a dozen technical solutions for consideration to improve performance for the ~56% of WordPress sites that use translations.

“Initial benchmarks showed that the median loading time for a localized site can be up to 50% slower than for non-localized sites, depending on which themes and plugins are being used,” Google-sponsored WordPress core committer Pascal Birchler said.

Based on recent discussions on GitHub, the Performance team has whittled it down to an updated list of six possible top contenders for speeding up sites with translations, including the advantages and disadvantages of each:

  • Solution A: Use different file format
  • Solution B: Native gettext extension
  • Solution C: Cache translations
  • Solution D: Lazily evaluated translation calls
  • Solution E: Optimize/Rewrite existing MO parser
  • Solution F: Splitting up translation files

Localized WordPress sites currently download .po and .mo files that contain the translations, but the first suggested solution proposes storing translations in .php files and using the .mo file as a fallback, as Birchler proposes that PHP loading and executing another PHP file would be a faster approach. He has a proof of concept on GitHub at at swissspidy/wp-php-translation-files and swissspidy/ginger-mo.

“When looking at all these factors, it appears that a revamped translations parser (solution E) could bring the most significant improvements to all localized WordPress sites,” Birchler said. “Especially when combined with a new PHP translation file format (solution A), which Ginger MO supports, the i18n overhead becomes negligible. Of course the same risks associated with introducing a new format apply.

“On top of that, a revamped i18n library like Ginger MO could also be combined with other solutions such as caching or dynamic MO loading to potentially gain further improvements. However, those routes have yet to be explored.”

The Performance team plans to test these ideas further on a wider scale through its Performance Lab feature project after gathering feedback from the broader community. August 6, 2023, is the deadline for leaving feedback on the proposal, which includes benchmarks and more details from the analysis.


13 responses to “WordPress Performance Analysis Finds Translations May Significantly Slow Down Sites”

  1. I’m surprised that they are only noticing that now. First thing I have noticed when using WPML… though I did like working with that plug-in. I find WooCommerce had a similar effect thigh not as bad. I hear some say that you should use a caching plug-in but, can’t they just tune these things to run a bit faster.

  2. I mean, a lot of those website probably use WPML which is, as we call it in french, “une usine à gaz”… Performance is terrible on every site that use it. That’s why I ditched it in favor of other solutions (Polylang currently) and run smoothly on more than 30 websites.

    More ways to integrate translation would be welcome though… and maybe one day an official multilingual (or native even?!) solution for WordPress will be reality. I’ve always been surprised by the lack of fully functional and recommended free (libre) multilingual solution for WP…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: