📜 ⬆️ ⬇️

Performance Comparison PHP 7.0 and HHVM



For quite some time, there was no news about him, but after a long wait, PHP 7 finally came out on December 3, 2015. We decided to test the most popular CMS based on PHP to test how they work with PHP 7.

This is a great day for anyone who regularly uses PHP - for developers, hosting companies, and even end users. The release of the new version will give a powerful impetus to the development of this popular language of web development. And ultimately this will result in faster operation of websites and web services.

We pay a lot of attention to optimizing website load times, and have released a number of tutorials on the topic, for example: A Beginner's Guide to Website Speed ​​Optimization , Best Free Website Performance Testing Tools and others .
')
To evaluate the performance of the new PHP interpreter, we drove through several benchmarks a number of popular products using PHP 5.6.16, PHP 7.0 and HHVM 3.10.1. Tests were conducted on the “bare gland”, so that virtualization does not affect the final result. Participated in the comparison:


Looking ahead, let's say that HHVM won. In our project, we will not abandon the policy of "HHVM-first-all." Since we focus on sites with high traffic, the best technologies of all available are of paramount importance for us, and this is clearly not PHP 7. Nevertheless, we will offer a new version as a backup solution, and gradually move to it from PHP 5.6 in the coming weeks.

Server configuration, which was used for benchmarks:


We also used MariaDB 10.1.9 for the MySQL server and Nginx 1.9.7 for the web server.

WordPress 4.4


As a test site, the main page of the newly installed wptest.io was chosen. Within a minute, this page was simultaneously loaded with 15 users. For WordPress, this was the only test where we could use HHVM's Repo Authoritative mode without time-consuming software modification. This could increase productivity, but not everyone will do it.




WordPress 4.3.1


Here, 15 users again within a minute simultaneously loaded the wptest.io main page.




Drupal 8.0.1


As a test site, we used a freshly installed CMS in the standard configuration. 50 teasers with demo data (via the Devel module) were displayed on the main page. The page was loaded for 15 minutes at the same time.

We got such an interesting result that after testing we completely removed Drupal, reinstalled it according to the instructions and repeated all the tests. And got similar results!




Magento 2.0 Community Edition


A standard installation with official demo data was used. We had to turn on the internal Magento cache, because otherwise we received a frivolous 5 op / sec. The home page was simultaneously loaded with 15 users at the same time.




OctoberCMS


This CMS, based on Laravel, gave us the opportunity to test the Laravel framework itself at the same time. During the installation, we chose the Vanilla theme, which includes the user system, a blog and a forum. Within a minute, the main page simultaneously loaded 15 users.




PyroCMS v3 beta2


Another CMS based on Laravel. We used the standard installation, added one post to the blog, and this “separate page” was simultaneously tested by 15 users for one minute.




Laravel 5.1.11


We installed the default Laravel framework package and tested its “welcome screen” without any connections to the database. Do not forget that OctoberCMS, tested above, is based on Laravel, so it looks like you are adding additional modules, and HHVM itself takes the initiative. We ran tests for one minute with 10 users at the same time.

When using the php artisan –force and php artisan config:cache optimization commands, the results were one and a half times better than those presented below.




Flarum v0.1.0-beta.4


Flarum is a delightfully simple forum creation software. This is a common successor to esoTalk and FluxBB. Since it uses a combination of Laravel, Zend frameworks and symfony components (an actual software suite in the PHP world), we decided that it would be interesting to include it in the list.

But it seems that we got a little hot, and in this article for Flarum we will have to leave the stub - it does not work with either HHVM or PHP 7. On HHVM we get the error “Fatal error: Return inside a finally block is not supported in vendor/flarum/core/src/Foundation/Application.php on line 120” and in PHP 7, the message: “Notice: Undefined property: stdClass::$data in vendor/flarum/core/src/Http/Controller/ClientView.php on line 326” . In addition, there are numerous JavaScript errors.

Summary


The results presented in the diagrams speak for themselves. If you want to include another framework or application in the test, let us know! Comments on tests are welcome.

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


All Articles