Every year we try to carefully measure the performance of different versions of PHP and HHVM on various platforms. This year, we measured four versions of PHP and HHVM on 20 platforms / configurations, including WordPress, Drupal, Joomla !, Laravel, Symfony, and many others. We also tested popular e-commerce solutions like WooCommerce, Easy Digital Downloads, Magento and PrestaShop.
We have always recommended WordPress users not to neglect the benefits of the freshest supported versions of PHP . Not just for the sake of safety, but also for the sake of increased productivity. And it is not only about WordPress, it is mostly true for all platforms. And today we will demonstrate how PHP 7.2 wins a crushing victory !
This year, the benchmark results are very different from last year, when the winner was HHVM. We were impressed that PHP 7.2 took the lead in speed. It should be noted that in relation to WordPress HHVM is no longer supported and will gradually go off the stage. We no longer recommend our customers to switch to HHVM and note that its support for other platforms has also decreased.
This is good news for developers and end users, since you can now focus on PHP and create faster sites and web services.
We tested 20+ platforms / configurations with five different engines, and PHP 7.2 won the gold medal with a 14/20 result!
For each test, we took the latest version of each platform and measured the operation of the main page with 15 simultaneous users for a minute. Test bench:
opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.revalidate_freq=60 opcache.fast_shutdown=1 opcache.enable_cli=1
The tests were performed by Torik Firdaus ( Thoriq Firdaus ), one of the WordPress developers and support engineer at Kinsta. Torik participated in the creation of WordPress Core and the WordPress localization editor for Indonesia .
PHP is a hypertext preprocessor. Today it is one of the most popular scripting languages ​​on the net. According to W3Techs, PHP is used on 83% of sites using server-side programming languages.
Due to PHP performance issues, the Facebook team developed the HipHop Virtual Machine ( HHVM ). This is a system that uses JIT compilation (just-in-time) to convert PHP code into machine code for the sake of PHP and iron synergy, on which this code is executed.
We tested 20 platforms / configurations. In some cases, due to the lack of support for a specific version of PHP, I had to test several versions. All measurements - the number of requests per second. The higher the value, the better.
The first platform to be tested was, of course, our favorite WordPress (perhaps we are a little biased because we live this CMS daily). In fact, WordPress is open source software that you can use to create great sites, blogs, or applications. Today, WordPress accounts for about 29% of all sites on the Internet, that is, more than a quarter.
We used the free Twenty Seventeen theme to measure WordPress performance. To fill in, they took fake content from wptest.io and tested the main page for a minute, which was simultaneously viewed by 15 users.
Docker image taken from https://hub.docker.com/_/wordpress/
Wordpress benchmarks
Benchmark Results
Defeated PHP 7.2, it was a little faster than HHVM. This is an important change from the benchmarks of 2016, when the clear winner was HHVM. In addition, PHP for WordPress is much more stable. We ourselves faced numerous problems in the operation of HHVM. And if you compare PHP 7.2 with PHP 5.6, the difference in performance turns out to be threefold!
WooCommerce is a fully customizable open-source WordPress based platform. In addition, this is one of the most popular e-commerce solutions, it employs over 42% of all commercial sites .
For this test, we took WordPress with WooCommerce installed and a free Storefront eCommerce theme.
Docker image taken from https://hub.docker.com/_/wordpress/
WordPress + WooCommerce
Benchmark Results
WooCommerce had difficulty working with HHVM, and PHP 7.2 won PHP 7.1 with a slight advantage.
Easy Digital Downloads (EDD) created Pipin Williamson (Pippin Williamson). This is a free WordPress plugin that helps authors and developers sell digital products.
After seeing how WooCommerce works, we tested WordPress with just one installed Easy Digital Downloads. Used free theme EDD Starter Theme .
Docker image taken from https://hub.docker.com/_/wordpress/
WordPress + Easy Digital Downloads
Benchmark Results
PHP 7.2 dominates.
Drupal is an open-source CMS that has gained popularity due to its modular system and strong developer community. It appeared in 2000 and, according to W3Techs, is used by approximately 2.2% of all sites , occupying 4.4% of the CMS market.
We used the free Bartik 8.4.4 theme. Note that Drupal 8.4.x is incompatible with PHP 7.2 ( # 2932574 ), so we did not test the engine.
Drupal
Benchmark Results
Since the latest version of Drupal does not support PHP 7.2, HHVM was the winner. Although if you look at the performance improvements in previous versions of PHP, then we can safely assume that 7.2 would work even faster.
Joomla! - Free CMS with open source content publishing. She first came out in August of 2005. Joomla! built on the basis of the framework for web applications according to the model-view-controller scheme and, according to W3Techs, is used by 3.1% of all sites on the Internet.
For testing Joomla, we used the free Beez3 template.
Joomla!
Benchmark Results
On the example of Joomla, we see a steady increase in PHP performance from version to version. But HHVM is still leading.
Magento is a popular open-source platform written in PHP. She appeared in March 2008. According to W3Techs, Magento runs on 1.2% of all sites .
To test the Magento 2 benchmark, we used the free Luma theme. Since PHP 5.6 was supported only by version 2.1.11, we had to run benchmarks on two versions of Magento. We installed it with sample data and a theme bundled. For additional testing, version 2.2.2 was used. Magento 2 does not yet support PHP 7.2 and the latest version of HHVM.
Magento 2
Benchmark Results
Since Magento 2 does not support PHP 7.2 and the latest version of HHVM, the winner was PHP 7.1. An impressive performance increase from version to version.
Grav is a simple but powerful open-source CMS that does not require a database. It is also sometimes referred to as “flat-file-based CMS”.
We used the free Clean Blog package. Note that Grav CMS is no longer compatible with the HHVM compiler , and the HHVM environment has been removed from the Travis assembly.
Turn off page and file caching https://learn.getgrav.org/advanced/performance-and-caching , Twig caching works.
Grav CMS
Benchmark Results
PHP 7.2 won again.
October CMS is a free open-source modular CMS platform with its own server, built on the basis of PHP-framework Laravel. For the first time she came out in May 2014.
We used the free Clean Blog Theme. October CMS is no longer compatible with PHP 5.6 and HHVM . And although we could cheat the installer by removing the PHP check, the configuration wizard crashed with an error of 500.
Number of posts: 5 with two panels on the left (Recent posts and Follow me)
October CMS
Benchmark Results
Two engines are not supported, however PHP 7.2 won again.
It's nice that all these not so large CMS refuse to support older versions of PHP. This is one of the advantages inherent in products that are not too large. Unfortunately, when it comes to WordPress and other platforms with large market shares, progress slows down due to backward compatibility considerations.
Laravel is a very popular open-source PHP framework used to create web applications. It was developed by Taylor Otwell and released in June 2011.
In this test, we used a clean HTML theme. The tests were run several times, the arithmetic mean was taken. Details can be found here .
posts
table.post_title
, post_content
, post_author
, created_at
and updated_at
.Before benchmarks, the following composer commands are executed: dump-autoload –classmap-authoritative, php artisan optimize –force, php artisan config: cache, php artisan route: cache.
Laravel 5.4.36
Benchmark Results
HHVM - undoubted winner.
Laravel 5.6 is incompatible with HHVM and requires PHP 7.1 or higher.
Laravel 5.6
Benchmark Results
The striking difference between the results of Laravel 5.6 PHP 7.2 and Laravel 5.4.36! Recent versions of PHP have clearly benefited from Laravel.
Symfony is a set of reusable PHP components and a PHP framework for creating web applications, APIs, microservices, and web services. It was released in October 2005.
Here we used Symfony Demo with MySQL (SQLite is used by default). Tests were carried out several times, the arithmetic average was taken. HHVM threw an error 500. Details can be read here .
In the main file (app.php) caching is disabled (AppCache).
Symfony 3.3.6
Benchmark Results
PHP 7.2 won again!
Symfony 4.0.1 requires PHP 7.1 or higher. And again HHVM threw an error 500.
In version 4.0.1, AppCache is not implemented in the main file (index.php).
Symfony 4.0.1
Benchmark Results
PHP 7.2 is king of the hill again.
PyroCMS is an open-source extension for Laravel that accelerates the creation of websites and applications using this framework.
We used the free theme Accelerant Theme (goes by default in PyroCMS). PyroCMS does not work in HHVM, probably because of Laravel.
Debug mode enabled (APP_DEBUG = true)
PyroCMS
Benchmark Results
The results are close to PyroCMS, but PHP 7.2 was again the best.
Pagekit is a lightweight, modular, open-source CMS that allows you to create great websites. She came out in the spring of 2016.
We used the free One theme (goes to Pagekit by default).
Test URL: / blog
Pagekit
Benchmark Results
Pagekit had difficulty working with HHVM. PHP 7.2 is a clear winner.
Bolt is an open-source content management tool that authors try to make as simple as possible. It is based on Silex and Symfony components, uses Twig, as well as SQLite, MySQL or PostgreSQL.
We used the free Bolt Base 2016 theme. HHVM is not supported ( # 6921 ).
Sessions included
Bolt CMS
Benchmark Results
It is clearly seen that with each new version of PHP, the performance of Bolt CMS is growing.
Anchor is a very simple and compact open-source blogging system.
We used the default Default Theme theme.
Number of publications: 5
Anchor cms
Benchmark Results
The results of PHP 7.1 and PHP 7.2 are very close, but PHP 7.1 was slightly faster.
PrestaShop is a popular and very rapidly developing open-source solution for online stores. The first version was released in 2008, and, according to W3Techs, PrestaShop is used on 0.6% of all sites .
We have a free Classic Theme theme. PrestaShop does not support HHVM .
Page caching disabled, smart caching enabled
PrestaShop
Benchmark Results
The results are almost the same, but PHP 7.2 has come out on full health.
Craft CMS is a product for developers, designers and web specialists, distinguished by flexibility of use, wide possibilities and simple use.
We took the free theme by default.
CraftCMS comes with its own Docker file. We set it up a bit for compatibility with Nginx.
Craft cms
Benchmark Results
Craft CMS does not work well with HHVM. But then PHP 7.2 is back on the horse!
Fork is a simple open-source CMS that uses symfony components. Here we used the default free theme, Fork Theme . Fork CMS requires PHP 7.1 or higher, it does not support HHVM.
Test URL: / modules / blog
Fork cms
Benchmark Results
PHP 7.2 outperformed PHP 7.1.
If these results did not convince you, then we really do not know what will convince you at all. Just a friendly reminder if you are a Kinsta client: we released PHP 7.2 in December 2017. If you need to increase productivity, you can easily upgrade to PHP 7.2 with one click in the MyKinsta panel.
If you are concerned about the incompatibility with third-party plug-ins (this is possible), then this is exactly what platforms are needed for. You can test without risk for your production-site.
As you can see, PHP 7.2 is leading in performance on all platforms .
Source: https://habr.com/ru/post/350686/
All Articles