The WordPress Performance Lab Plugin Goes Live

What is the Performance Lab Plugin For?

The purpose of the plugin is to give publishers the opportunity to best test new performance boosting improvements and features that are being considered for a future release of the WordPress core, the main WordPress files that powers websites.

This allows publishers to acquire advanced previews of improvements that could be included by default within future versions of WordPress.

Over the past six months, a number of our performance specialists at XWP have been supporting teams at Google and Yoast to build and launch the WordPress Performance Lab plugin and work on WordPress Core Performance. 

Performance Lab plugin is a collection of modules designed to monitor and enhance the performance of your WordPress site, many of which will eventually be merged into WordPress core. The plugin allows you to individually test each functionality on your own install before they become available in WordPress Core, test that they work as expected, add improvements and provide feedback.

Performance Lab Plugin Uses a Modular Interface

The plugin is currently made up of five individual modules that are related to specific performance improvements. Some of the modules are health checks, for example, and others are actual improvements that can help speed up a website.

The modular approach allows publishers to test only those features that they want to try out.

The History of Performance Lab Plugin

In October 2021, Google and Yoast WordPress contributors posted a proposal to create a dedicated performance team that would be responsible for improving speed and performance in WordPress Core. The proposal was well-received, and in November, work began on the official Performance Lab plugin.

Noticing the opportunity to lend our performance expertise, a number of our WordPress Core Contributors joined the team and set to work on building the first stable release of the plugin.  

On the 18th of April 2022, the WordPress Performance Lab Plugin version 1.0.0 was released publicly, to much adoration from the WordPress community. At the time of writing (one week after release), it already has over 14,000 downloads and a sturdy 4.9-star rating.

Download the WordPress Performance Lab Plugin Today

XWP’s Recent Contributions to the Performance Lab Plugin

Representatives from XWP’s performance team have worked on a number of tickets for the Performance Lab plugin, but efforts were primarily focused on two key areas: Object caching and image performance.

Low-Quality Image Placeholders

When looking into improving user activity metrics, you quickly come to learn how important perceived speed is. Any millisecond where a user can’t see that something is loading, you run the risk of losing them forever.

So, in order to help WordPress users render their content more quickly, the team started work on new functionality to display a blurred version of an image before its full version has had the chance to download into the browser. 

After running a thorough discovery process, however, the team found that all the libraries that were necessary to create such a functionality required PHP 7.3+, whereas WordPress still supports down to PHP 5.6

Ensuring that the Performance Lab plugin works on all PHP versions currently supported by WordPress is important, as many of the modules will eventually be merged into WordPress Core. So, a novel solution was required.

To overcome this challenge, they created a function that, on upload, determines the dominant color of an image, caching the information and displaying it as a placeholder.

This is also the most performance-friendly way of handling this issue. Instead of loading a pixelated version, (which would require a greater amount of compute power to generate) the code behind the scenes for the color-picking functionality is nimble, and can be called upon with a single line of CSS.

“People like to see progress on their requests, and they get frustrated when they feel like nothing’s happening—when the screen’s just white. That’s why Time to First Paint is so important. It’s all about the first time you actually see something on the page.”

-Jonny Harris, XWP Core Performance Contributor 

There are numerous other advantages to having the dominant color of an image available, including:

  • Dynamically set CSS styling by calling on image color
  • Improve CWV metrics for TTFP
  • Programmatically overlay text on a cover image, based on W3 contrast standards
  • Automatically to-add image color information for alt text   

Object Caching and Database Performance. 

The XWP performance team also worked on a WordPress core patch to improve object caching. The primary focus of this was to audit and fix the existing caches to reuse caches where possible. 

This means that if data is queried, and subsequently cached, and then the same or similar queries are requested again, the same cache can be reused. The result of this is far fewer queries on the database and less memory used on-page.
Per average page requests, there are around 56 database queries performed by WordPress core. After the performance improvements, our team managed to get this number down to around 46— Now, to those who aren’t well-versed in technical performance, 10 queries per page might not sound like a lot, but consider that’s a fifth of the total page database queries.

This has numerous benefits: Pages load faster, less memory (RAM) on the server is used to display the page, and there is less load on the database server, so that if your site is ever victim to a DDOS attack, you will stay online for longer.

But potentially the most exciting part of this development is that it is completely scalable: The more stuff that’s on the page, the more savings you get.

This can be seen in the work the XWP performance team did in relation to menus, where all terms and posts are loaded and linked to menu items in one request. Instead of generating lots of queries, we are now able to achieve the same result with only two queries (one for terms and one for posts).


Related Post

Leave a Reply

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