📜 ⬆️ ⬇️

Exhaustive benchmarks PHP 5.6, 7.0, 7.1, 7.2 and HHVM (2018)


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!


PHP and HHVM benchmarks (2018)


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 .


What is PHP?


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.


What is HHVM?


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.


Tested Platforms and Configurations


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.



WordPress 4.9.4


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.



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!


WordPress 4.9.4 + WooCommerce 3.3.1


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.



Benchmark Results



WooCommerce had difficulty working with HHVM, and PHP 7.2 won PHP 7.1 with a slight advantage.


WordPress 4.9.4 + Easy Digital Downloads 2.8.18


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 .



Benchmark Results



PHP 7.2 dominates.


Drupal 8.4.4


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! 3.8.5


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 2 (CE) 2.1.11 + 2.2.2


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 CMS 1.3.10


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.



Benchmark Results



PHP 7.2 won again.


October CMS 1.0.433


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.



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 5.4.36 + 5.6


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 .



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 3.3.6 + 4.0.1


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 .



Benchmark Results



PHP 7.2 won again!


Symfony 4.0.1 requires PHP 7.1 or higher. And again HHVM threw an error 500.



Benchmark Results



PHP 7.2 is king of the hill again.


PyroCMS 3.4.14


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.



Benchmark Results



The results are close to PyroCMS, but PHP 7.2 was again the best.


Pagekit 1.0.13


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).



Benchmark Results



Pagekit had difficulty working with HHVM. PHP 7.2 is a clear winner.


Bolt CMS 3.4.8


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 ).



Benchmark Results



It is clearly seen that with each new version of PHP, the performance of Bolt CMS is growing.


Anchor CMS 0.12.6 (pre-release)


Anchor is a very simple and compact open-source blogging system.



We used the default Default Theme theme.



Benchmark Results



The results of PHP 7.1 and PHP 7.2 are very close, but PHP 7.1 was slightly faster.


PrestaShop 1.7.2.4


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 .



Benchmark Results



The results are almost the same, but PHP 7.2 has come out on full health.


Craft CMS 2.6.3011


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.



Benchmark Results



Craft CMS does not work well with HHVM. But then PHP 7.2 is back on the horse!


Fork CMS 5.2.2


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.



Benchmark Results



PHP 7.2 outperformed PHP 7.1.


We in Kinsta switched to PHP 7.2.


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.


Impressions of the benchmarks results


As you can see, PHP 7.2 is leading in performance on all platforms .



')

Source: https://habr.com/ru/post/350686/


All Articles