WordPress PHP Performance Benchmark (2019)
Robert-Jan Budding, January 15, 2019
PHP 7.3 was released on 6 December. This version is now also available on our platform. PHP 7.3 offers a number of improvements over the previous versions, including a new way to handle JSON errors, a more flexible way to use the heredoc and nowdoc syntax and Argon2 password hash improvements. Because WordPress works with PHP it is good to know which version is best to use.
Almost simultaneously, the official version of WordPress 5.0 was released. In this release, the much talked about text editor Gutenberg is enabled by default. Want to know what Gutenberg means to you? Then read our blog about the changes Gutenberg brings with it written, and why updating to Gutenberg is not always wise.
The websites we host must be as fast as we can make technically possible. That is one of our main drivers. As real geeks, we also love figures. Therefore, just like when PHP 7.0 was released, we started to benchmark the differences in speed between 4 different versions of PHP. Namely, PHP 5.6, 7.1, 7.2 and the latest version, 7.3.
But that’s not all…
Gutenberg and the Classic Editor tested
We tested these versions with the standard Gutenberg editor and with the Classis Editor plugin, which many WordPress users have installed after updating to WordPress 5.0. Does install the plugin matter for your speed, and if so, which PHP version is the most sensible to use? For this, we used a clean WordPress installation, with version 5.0.2, in which 450 blog posts have been published. The theme used is the standard TwentyNineteen.
We also wanted to know what the differences in speed are when you use e-commerce solution WooCommerce. We installed WooCommerce, version 3.5.3, on the latest version of WordPress, 5.0.2. It contains 650 products and 450 blog posts. These versions are also tested with and without the Classic Editor plugin. The standard Storefront theme has been used.
PHP Benchmark (2019): 5.6, 7.1, 7.2 and 7.3
For each test, the following standard configurations were used:
- List version VPS One (Linode server, which runs in Frankfurt)
- WP version: 5.0.2
- PHP versions: 5.6, 7.1, 7.2, 7.3
- Caching: varnish disabled using no-cache header
- OPCache: enabled according to best practices within our own platform
- Plugins: Yoast SEO and our own Warpdrive plugin
Two tests were performed per configuration:
- webpagetest.org: 9 tests each, with option Stop test at DOM complete and the header. The result is a Load Time, Time to First Byte and Render start. Lower is better
- loader.io: 50 concurrent users for 1 minute, with header Cache-Control: no-cache, must-revalidate. The result is average response time, with min/max response times. Again, lower is better
The following configurations have been tested:
- WordPress 5.0.2
- WordPress 5.0.2 with Classic Editor plugin, version 1.3
- WordPress 5.0.2 with WooCommerce 3.5.3
- WordPress 5.0.2 with WooCommerce 3.5.3 with Classic Editor plugin, version 1.3
Apart from the articles/products, no further changes have been made to the configurations.
WordPress 5.0.2 speed
The first configuration that has been tested is a ‘bare’ WordPress installation, with only the Yoast SEO and the Savvii Warpdrive plugin installed. A blog post URL was used to test the configuration.
Between PHP 5.6 and 7.1 we see little difference. PHP 7.2 is already a bit faster, especially on the Time to First Byte (TTFB), with almost 25%. On PHP 7.3 the site runs fastest by far, with a 17% faster load time than 7.2 and 44% faster TTFB. What do the results look like for Loader.io:
Here we see a similar trend. PHP 5.6 is by far the slowest with a response time of 4681 milliseconds. PHP 7.1 is now a lot faster with 3414 milliseconds, but PHP 7.3 wins with 1321 milliseconds. A reduction of the loading time of almost 72%.
It is clear that in both tests PHP 7.3 is by far the fastest version of PHP to run your WordPress website with Gutenberg and without WooCommerce. What if we turn on the Classic Editor?
WordPress 5.0.2 with Classic Editor speed
Because we are interested in whether scaling up the Classic Editor plugin (CE) makes a difference, we installed it in our test environment, emptied the (OP)cache and started testing all versions of PHP again. These results look like this:
We see that the plugin does not seem to have much influence, except for PHP 5.6. With the other versions the difference is not that big, but the loading times are all a bit slower. PHP 7.3 is the fastest in this test (over 21% faster than 7.2). This also applies to the TTFB, where the differences between the 7.x versions seem to get smaller. What about the response times?
Here it is particularly interesting to see that the 7.x versions show an average faster response time of more than 30%. Different independent tests have been performed from each other, and these tests show the same results every time. PHP 5.6 is again far behind, the difference in response times between 5.6 and 7.3 has now increased to 77%.
These tests show something interesting. When using PHP 7.x the response times of the website will be lower (lower is better). The TTFB gets a bit higher, and during the loading times, there is little difference. From this test, it seems that we can continue to work with the classic WordPress editor for a while and that we certainly don’t have to switch for speed. Maybe it’s even better to wait a while because of the big differences in response times.
We also investigated the influence of WooCommerce on the different versions of PHP and which version is best used for this. We also found it interesting to see if and if so, what influence the use of the Classic Editor has on WooCommerce. We start with the test without CE.
WordPress 5.0.2 + WooCommerce 3.5.3 speed
An empty configuration of WordPress is installed on which WooCommerce is installed without any further plugins. The webshop is already filled with 650 articles. Which influence the latest versions of PHP on WordPress with WooCommerce.
Whereas without the WooCommerce plugin PHP 7.3 was the fastest in all tests, here we see a different result when it comes to loading times. PHP 7.1 wins here with 5.502. PHP 5.6 is the slowest (6.291), but is soon followed by PHP 7.3 (6.247).
Looking at the TTFB we see the familiar pattern again. PHP 5.6 has the height TTFB (0.724), PHP 7.3 the lowest with 0.361. The response times show a similar trend:
The first thing that strikes us here is, of course, the absence of PHP 5.6 data. For the Loader.io test, an error threshold of 50% was used with a timeout of 10 seconds. If the server does not respond within 10 seconds with a response, the request is canceled. When this happens in more than 50% of the cases the test stops.
In this test, we see that PHP 7.3 wins again with a response time of 4282 milliseconds. PHP 7.1 is faster than PHP 7.2 in this test.
It looks like the WooCommerce plugin is responding well to PHP 7.1. Especially the page loading time is good when using PHP 7.1. Looking at TTFB and response time, PHP 7.3 is the fastest in both tests.
You may not want to use Gutenberg for your WooCommerce shop yet. Does this make a difference in speed?
WordPress 5.0.2 + WooCommerce 3.5.3 + Classic Editor 1.3 speed
As with the previous tests, we installed the CE plugin in the same installation and started testing again.
Again, it is striking that there is little difference between PHP 5.6 and PHP 7.3 (6,353 vs. 6,274). Both PHP versions are slowest in this configuration when it comes to the page loading time. PHP 7.1 and 7.2 are almost identical, 5,950 vs. 5,954 respectively.The same we see with these versions for the TTFB, they are almost equal to each other. PHP 7.3 is also the winner here, with 0.384 seconds, compared to the slowest of the four, PHP 5.6 with 0.712 seconds. More than 46% slower. What does this look like for the response times?
Again there are no test results for PHP 5.6 due to too high an error content. It seems that when using this version WooCommerce with many simultaneous users it gets very hard.
When using PHP 7.1 or PHP 7.2 the response times will deteriorate again. For PHP 7.1 the difference is greatest with 45%. PHP 7.2 is 20% faster without the CE-plugin. Looking at the winner, PHP 7.3, we see that the response times remain almost the same, 4282 milliseconds versus 4268.
What PHP version is the fastest for WordPress?
The test environment consisted of a WordPress 5.0.2 installation. Besides this standard installation, we also tested it with the latest version of WooCommerce.
Because the new WordPress word processor, Gutenberg, is a bit of a nuisance, we also tested the configurations with the Classic Editor plugin. This replaces the Gutenberg block editor with the classic editor, it is already a bit hidden in the name ?.
The following table gives an overview of all the results:
|WordPress + WooCommerce||WordPress + WooCommerce + CE||WordPress||WordPress + Classic Editor|
|PHP||Load Time (sec.)||TTFB (sec.)||Response Time (ms.)||Load Time (sec.)||TTFB (sec.)||Response Time (ms.)||Load Time (sec.)||TTFB (sec.)||Response Time (ms.)||Load Time (sec.)||TTFB (sec.)||Response Time (ms.)|
The bold results are the best times per category. This is more than clear than PHP 7.3 is the fastest version of PHP. In other words, your website loads a lot faster when using this version of PHP.
Don’t want to use Gutenberg (yet)? Then use the Classic Editor. In that case, it is definitely wise to use the PHP 7.3. This plugin is the least ‘bothered’ by this plugin and seems to respond even faster without WooCommerce installation.
The most important takeaways at a glance:
- PHP 7.3 is almost always the fastest choice. Is your website still running on PHP 5.6? Except that your website is slower than necessary, it is probably also unsafe. PHP 5.6 will not receive any new security updates anymore.
- Always test before updating. Especially when going from version 5 to 7. Some parts of your site may not work properly anymore. Luckily we have a good solution for that: Staging. Put your website on a staging environment first so you can test with the new version and if everything works properly, you can update with confidence.
- The latest versions of PHP are available from us, so also 7.3. Remove the old versions from our platform as soon as possible, to avoid security problems as much as possible. Are you a customer of ours and not yet left with at least PHP 7.1? Don’t wait and test today!
- In addition to PHP there are other factors to make your WordPress website faster (did we already say we like it fast??). Read the Ultimate Speed Checklist to get to know them.