Improving WordPress Translation Performance

By Tristan Darricau, on Apr 22, 2015

Blackfire is still in beta and we are working hard to make it better everyday. In order to exercise the UX as much as possible, we decided to profile several widely used Open-Source projects. This is the first blog post of a new series on this topic.

When you don’t know the inners of an application, run Blackfire on it and you’re going to see how its internals work. That’s what we’ve done with WordPress; and we found out one hotspot that can be fixed easily.

As you can see on the screenshot below, the impact of the WordPress translation sub-system is quite significant (with more than 40ms per page):

impact

And view the full profile here.

We looked at the WordPress Plugin Directory for plugins able to mitigate this issue, and we found three of them: MO Cache, 001 Prime Strategy Translate Accelerator and WP Performance Pack. They all use the object cache API to store the translations. Enabling one of them gives impressive results: the .mo translation file isn’t parsed on every single page anymore, saving 40ms per request:

enhancement

And view the full profile here.

Unfortunately, these plugins lack visibility and popularity (only ~20,000 downloads for any of them) even if they allow great performance improvements for any non English WordPress installations. But now that you are aware, you should enable one! Especially since other popular performance related plugins do not address this issue (W3 Total Cache, WP Super Cache, …).

As we think this improvement should be made available to everyone out of the box, we’ve also submitted a patch to WordPress core. If it gets accepted, you would only have to install and enable a plugin implementing the Object Cache API to take advantage of this great speedup.

Stay tuned while we’re profiling your favorite Open-Source apps.

Happy Profiling!