Comparison of running efficiency between PHP 5.6, 7.0, 7.1, 7.2 and hhvm

Time:2022-5-13

Every year, we try to understand the performance benchmarks of different versions of PHP and hhvm on various platforms. This year, we comprehensively benchmark four different PHP engines and hhvm in 20 different platforms / configurations; Including WordPress, Drupal, Joomla!, Laravel, symfony et al. We also tested popular e-commerce solutions such as woocommerce, easy digital downloads, Magento and prestashop.

We have always encouraged WordPress users to take advantage of the latestSupported PHP versionsedition. They are not only safer, but also provide additional performance improvements. Of course, we’re not talking about WordPress, which is true on most platforms. Today we will show you how PHP 7.2 is invincible!?

This year’s results overturned the leading position of hhvm in previous tests. We are pleased to see that PHP 7.2 is the leading engine in terms of speed. It should be noted that WordPressHhvm is no longer supported, it will be completely removed later. We no longer encourage our customers to migrate to hhvm and inform them of its insufficient support for various platforms.

This is good news for both developers and users because it allows them to focus on PHP and provide everyone with faster websites and web services.

PHP & hhvm benchmark (2018)

In each test, we use the latest version of each platform and conduct a one minute home page test with 15 concurrent users. The following is the specific configuration of our test environment.

  • Computing host: 8x Intel (R) Xeon (R) CPU @ 2.20GHz (by)Google cloud platformProvide support and run in a separate container)
  • Operating system: Ubuntu 16.04.3 LTS
  • Docker environment: Debian 8, nginx 1.13.8, MariaDB 10.1.31
  • PHP engine: 5.6, 7.0, 7.1, 7.2
  • HHVM: 3.24.2
  • Opcache: WordPress, Joomla and Drupal. We use the official docker image. In other platforms, we use the image of opcache and use the followingphp.iniConfiguration file.

    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

These tests were conducted by WordPress contributors and support engineersThreatq FirdausAt kinsta. He contributed the core code of WordPress and translated the Indonesian versionWordPress

PHP

PHP: hypertext preprocessor. It is one of the most popular scripting languages on the Internet today. According to w3techs, in all server-side programming language websites,More than 83% use PHP 。

HHVM

Due to the performance problems of PHP, Facebook’s PHP team developed the hiphop virtual machine(HHVM)。 It is a system that uses just in time (JIT) compilation technology to convert PHP code into machine language to establish synergy between PHP code and the underlying hardware running it.

Test platform and configuration

Our tests include the following 20 platforms / configurations. In some platforms, due to the lack of support for specific PHP versions, we have to test multiple versions. Click the title below to directly jump to the corresponding test records and results. Test data is measured in requests per second. Of course, the more requests, the better.

WordPress 4.9.4

The first platform to be tested is of course our favorite:WordPressWe may be a little inclined to live and breathe this every dayCMS ?)。 WordPressThe core is the open source software you can use to create beautiful websites, blogs, or apps. actually,WordPressSupporting more than29% of all websites 。 More than a quarter of the websites you visit may beWordPressProvide support.

in the light ofWordPressBenchmark, we use freeTwenty Seventeen theme。 We use fromwptest.ioVirtual content and simulate the concurrency of 15 users to benchmark the home page for one minute.

  • Number of Posts: 10 / pagewptest.iogenerate
  • The search sidebar is the only published content on the sidebar
  • Docker ImageDerived fromhttps://hub.docker.com/_/word…

WordPressBenchmark test

Benchmark test results

  • WordPress 4.9.4 PHP 5.6 benchmark result: 49.18 requests / sec
  • WordPress 4.9.4 PHP 7.0 benchmark result: 133.55 requests / sec
  • WordPress 4.9.4 PHP 7.1 benchmark result: 134.24 requests / sec
  • WordPress 4.9.4 # PHP 7.2 benchmark result: 148.80 requests / sec?
  • WordPress 4.9.4 hhvm benchmark result: 144.76 requests / sec

PHP 7.2Proof ratioHHVMA little faster to win. This is different from 2016HHVMThere are significant changes in the benchmark of obvious victory.PHP for WordPressAnd more stable. We metHHVMMany first-hand questions.

WordPress 4.9.4 + WooCommerce 3.3.1

WooCommerceIs one forWordPressBuild a fully customizable open source e-commerce platform. This is also one of the most popular e-commerce ending schemes for more than 20 people on the Internet42% of e-commerce platformsProvide support.

For the next test, we willWordPresswithWooCommerceInstall together. We use freeE-commerce store theme

WordPress + WooCommerceBenchmark test

Benchmark test results

  • WordPress 4.9.4 + woocommerce 3.3.1 PHP 5.6 benchmark result: 34.47 requests / sec
  • WordPress 4.9.4 + woocommerce 3.3.1 PHP 7.0 benchmark result: 84.89 requests / sec
  • WordPress 4.9.4 + woocommerce 3.3.1 PHP 7.1 benchmark result: 86.04 requests / sec
  • WordPress 4.9.4 + woocommerce 3.3.1 , PHP 7.2 benchmark result: 92.60 , request / sec?
  • WordPress 4.9.4 + woocommerce 3.3.1 hhvm benchmark result: 69.58 requests / sec

WooCommercestayHHVMIn the performance of struggle, at the same timePHP 7.2Slightly overPHP 7.1

WordPress 4.9.4 + Easy Digital Downloads 2.8.18

Easy Digital Downloads(EDD), developed by Pippin Williamson, is a free WordPress e-mall plug-in, which focuses on helping developers sell online goods.

After watching woocommerce’s performance, we willWordPressand EDDInstall together. We use freeEDD getting started topic

WordPress + easy digital downloads benchmark

Benchmark test results

  • WordPress 4.9.4 + EDD 2.8.18 PHP 5.6 benchmark result: 76.71 requests / sec
  • WordPress 4.9.4 + EDD 2.8.18 PHP 7.0 benchmark result: 123.83 requests / sec
  • WordPress 4.9.4 + EDD 2.8.18 PHP 7.1 benchmark result: 124.82 requests / sec
  • WordPress 4.9.4 + EDD 2.8.18; PHP 7.2 benchmark result: 135.74; request / sec? (best)
  • WordPress 4.9.4 + EDD 2.8.18 hhvm benchmark result: 127.74 requests / sec

stayWordPressandEDDDuring the test,PHP 7.2Still win.

Drupal 8.4.4

DrupalIs an open sourceCMSContent Management System, or “content management system”), is popular because of its modular system and powerful developer community. It was launched in 2000, according to w3techs,Drupal2.2% of all websitesCMS4.4% in the market(Detailed investigation) 。

For Drupal’s benchmark, we useBartik 8.4.4 theme。 be careful!Drupal 8.4.xincompatiblePHP 7.2 (detailed information)Therefore, we did not testPHP 7.2

DrupalBenchmark test

Benchmark test results

  • Drupal 8.4.4 PHP 5.6 benchmark result: 7.05 requests / sec
  • Drupal 8.4.4 PHP 7.0 benchmark result: 15.94 requests / sec
  • Drupal 8.4.4 PHP 7.1 benchmark result: 19.15 requests / sec
  • Drupal 8.4.4 PHP 7.2 benchmark results: (incompatible)
  • Drupal 8.4.4 hhvm benchmark result: 19.57 requests / sec?

becauseDrupalThe latest version of does not supportPHP 7.2HHVMWon the game. Looking at the performance of the previous version of PHP (7.1), we can boldly speculatePHP 7.2Will be faster!

Joomla! 3.8.5

Joomla!It is a free and open source platform for publishing web contentCMS, originally released on August 17, 2005. He was founded onmodel--view--controllerIn the web application framework, according toW3TechsHe was on the Internet3.1% of all websitesUse.

in the light ofJoomla!Benchmark, we use freeBeez3 framework

  • Number of Posts: 4 (according to the default during installation)Joomla(post)
  • The default sidebar is not published
  • Docker ImageDerived fromhttps://hub.docker.com/_/joomla/

Joomla!Benchmark test

Benchmark test results

  • Joomla! 3.8.5 PHP 5.6 benchmark result: 26.42 requests / sec
  • Joomla! 3.8.5 PHP 7.0 benchmark result: 41.46 requests / sec
  • Joomla! 3.8.5 PHP 7.1 benchmark result: 41.17 requests / sec
  • Joomla! 3.8.5 PHP 7.2 benchmark result: 42.36 requests / sec
  • Joomla! 3.8.5 hhvm benchmark result: 51.84 requests / sec?

stayJoomla!We can see in various versionsPHPSteady performance improvement in. butHHVMStill ahead.

Magento 2 (CE) 2.1.11 + 2.2.2

MagentoWritten on March 31, 2008, PHP is a popular e-commerce platform. According to w3techs, it supports1.2% of all Internet

For Magento 2 benchmark, we use freeLuma theme。 We used two versions because 2.1.11 is the only version that supports PHP 5.6. We installed sample data and default themes. For other tests, we use version 2.2.2. Magento 2 currently does not support PHP 7.2 or the latest version of hhvm.

Magento 2 benchmark

test result

  • Magento 2 (CE) 2.1.11 PHP 5.6 benchmark result: 10.75 requests / sec
  • Magento 2 (CE) 2.1.11 PHP 7.0 benchmark result: 20.87 requests / sec
  • Magento 2 (CE) 2.1.11 PHP 7.1 benchmark result: 29.84 requests / sec?
  • Magento 2 (CE) 2.1.11 PHP 7.2 benchmark result: not supported
  • Magento 2 (CE) 2.1.11 hhvm benchmark result: not supported

Since neither PHP 7.2 nor the latest version of hhvm supports Magento 2, PHP 7.1 is an obvious winner. It’s impressive that you can get consistent performance improvements through each version.

Grav CMS 1.3.10

GravIt is an easy-to-use but powerful open source cms without database. It is sometimes called flat file CMS.

For the benchmark of grav CMS, we used the freeClean blog framework。 It is worth noting that grav CMS is no longer compatible with hhvm compiler. It has been removed from TravisDeleted hhvm environment

  • Number of articles: 4 (preset posts in the “clean blog” framework)
  • Turn off page / file cachinghttps://learn.getgrav.org/adv…, twig cache is still available.

Grav CMS benchmark

test result

  • Grav CMS 1.3.10 PHP 5.6 benchmark result: 34.83 requests / sec
  • Grav CMS 1.3.10 PHP 7.0 benchmark result: 53.37 requests / sec
  • Grav CMS 1.3.10 PHP 7.1 benchmark result: 53.37 requests / sec
  • Grav CMS 1.3.10 # PHP 7.2 benchmark result: 55.12 requests / sec?
  • Grav CMS 1.3.10 hhvm benchmark result: not supported

We can see the most obvious winner in PHP (grav. 7) again.

October CMS 1.0.433

October CMSIt is a free, open source and self managed modular CMS platform based on laravel. It was originally released on May 15, 2014.

For October CMS benchmark, we use freeClean blog theme。 It should be noted that October CMS no longer supports PHP 5.6 and hhvm. Even if we can cheat the installer by removing the PHP check, it will report a 500 error in the configuration wizard, resulting in the installation failure.

  • Number of articles: 5 there are two sidebars on the left (latest posts and follow me)

October CMS benchmark

test result

  • October CMS # 1.0.433 PHP 5.6 test result: not supported
  • October CMS # 1.0.433 PHP 7.0 test result: 43.83 requests / sec
  • October CMS # 1.0.433 PHP 7.1 test result: 47.95 requests / sec
  • October CMS # 1.0.433 PHP 7.2 test result: 48.87 requests / sec?
  • October CMS # 1.0.433 hhvm test result: not supported

Even if we don’t support two engines, we can see PHP 7.2 win again.

It’s nice to see that these niche content management systems no longer support older versions of PHP. Although this is not a big advantage. Because when it comes to the fact that WordPress and other platforms occupy most of the market share, they develop slowly due to their compatibility.

Laravel 5.4.36 + 5.6

LaravelIs a very popular open source PHP framework for developing web applications. It was created by Taylor otwell and released in June 2011.

For the laravel benchmark, we used pure HTML themes. Run the test several times and take the average value. You can hereSpreadsheetSee more details in.

  • Number of Posts: 10BladeTemplate foreach circular display
  • The database has a 1postssurface
  • This table contains six fieldspost_titlepost_contentpost_authorcreated_atupdated_at
  • Close session
  • Run before benchmarking composer dump-autoload --classmap-authoritative, php artisan optimize --force, php artisan config:cache, php artisan route:cache

Laravel 5.4.36 benchmark

Benchmark test results

  • Laravel # 5.4.36 PHP 5.6 benchmark result: 66.57 req / sec
  • Laravel 5.4.36 PHP 7.0 benchmark result: 114.55 req / sec
  • Laravel # 5.4.36 PHP 7.1 benchmark result: 113.26 req / sec
  • Laravel # 5.4.36 PHP 7.2 benchmark result: 114.04 req / sec
  • Laravel 5.4.36 hhvm benchmark result: 394.31 req / sec?

Hhvm won by a large margin.

It should be noted that laravel 5.6 is not compatible with hhvm and requires PHP 7.1 or later.

Laravel 5.6 benchmark

Benchmark test results

  • Laravel # 5.6 PHP 5.6 benchmark result: incompatible
  • Laravel # 5.6 PHP 7.0 benchmark result: incompatible
  • Laravel 5.6 PHP 7.1 benchmark result: 411.39 req / sec
  • Laravel # 5.6 # PHP 7.2 benchmark result: 442.17 req / sec?
  • Laravel 5.6 hhvm benchmark result: incompatible

If you compare the benchmark results of laravel 5.6 PHP 7.2 with the benchmark results of laravel 5.4.36, the difference is amazing! Laravel runs very efficiently in the latest version of PHP.

Symfony 3.3.6 + 4.0.1

SymfonyIt is a set of reusable PHP components and a PHP framework for creating web, APIs, microservices and web services programs. It was released on October 22, 2005.

For symfony’s benchmark, we useSymfony DemoAnd MySQL (SQLite is used by default). The test is run multiple times and the results are averaged. An important point to note is that hhvm does not work well and throws 500 errors. You can be hereformFor more information.

  • Number of articles: 10
  • URL of the test: / en / blog/
  • composer dump-autoload -o, php bin/console doctrine:database:create, php bin/console doctrine:schema:create, php bin/console doctrine:fixtures:load, php bin/console cache:clear –no-warmup –env=prod

Symfony 3.3.6 benchmarking

Benchmark test results

  • Symfony 3.3.6 PHP 5.6 benchmark result: 81.78 req / sec
  • Symfony 3.3.6 PHP 7.0 benchmark result: 184.15 req / sec
  • Symfony 3.3.6 PHP 7.1 benchmark result: 187.60 req / sec
  • Symfony # 3.3.6 # PHP 7.2 benchmark result: 196.94 req / sec?
  • Symfony 3.3.6 hhvm benchmark result: not supported

PHP 7.2 is the champion again!

Please note that the operating environment of symfony 4.0.1 requires PHP 7.1 or above. At the same time, hhvm cannot work normally again and throws 500 errors.

Symfony 4.0.1 benchmark

Benchmark test results

  • Symfony 4.0.1 PHP 5.6 benchmark result: not supported
  • Symfony 4.0.1 PHP 7.0 benchmark result: not supported
  • Symfony 4.0.1 PHP 7.1 benchmark result: 188.12 req / sec
  • Symfony 4.0.1 # PHP 7.2 benchmark result: 197.17 req / sec?
  • Symfony 4.0.1 hhvm benchmark result: not supported

There is no surprise here. PHP 7.2 is on the top again.

PyroCMS 3.4.14

PyroCMSIt is an open source and essentially allows you to build websites and applications on the framework fasterLaravelExpansion.

in the light ofPyroCMSBenchmark, we use freeAccelerator theme(default)PyroCMSSubject). It is important to note thatPyroCMSNot inHHVMMay be due to dependencyLaravel

  • Number of Posts: 5
  • Debug mode on (app_debug = true)

PyroCMSBenchmark test

Benchmark test results

  • Pyrocms 3.4.14 PHP 5.6 benchmark result: not supported
  • Pyrocms} 3.4.14 PHP 7.0 benchmark result: 27.33 requests / sec
  • Pyrocms} 3.4.14 PHP 7.1 benchmark result: 27.81 requests / sec
  • Pyrocms 3.4.14 PHP 7.2 benchmark result: 29.28 requests / sec?
  • Pyrocms} 3.4.14 hhvm benchmark result: not supported

PyroCMSThe test results are very similar, butPHP 7.2Good performance again.

Pagekit 1.0.13

PagekitIs an open source modular lightweight CMS created by yootheme. It is a collection of tools for creating a better website. Pagekit was released in spring 2016.

In the pagekit benchmark, we use freeOne theme(pagekit default theme)

  • Number of articles: 5
  • Close cache
  • Test URL: / blog

Pagekit benchmark

test result

  • Pagekit 1.0.13 PHP 5.6 benchmark result: 51.70 requests / sec
  • Pagekit 1.0.13 PHP 7.0 benchmark result: 108.61 requests / sec
  • Pagekit 1.0.13 PHP 7.1 benchmark result: 112.30 requests / sec
  • Pagekit 1.0.13 PHP 7.2 benchmark result: 116.18 requests / sec?
  • Pagekit 1.0.13 hhvm benchmark result: 61.16 requests / sec

Pagekit looks a little anxious when running in hhvm, and PHP 7.2 obviously leads the test engines again.

Bolt CMS 3.4.8

Bolt CMS, orBolt, an open source content management tool, strives to be as simple and straightforward as possible. He basedSilexandSymfonyComponents, usingTwigas well asSQLiteMySQLperhapsPostgreSQL

in the light ofBolt CMSBenchmark, we use freeBolt base 2016 theme。 It is important to note thatHHVMUnsupported(#6921)。

  • Number of Posts: 5
  • Tested URL: / entries
  • SessionStill enabled

Bolt CMSBenchmark test

Benchmark Results

  • Bolt CMS # 3.4.8 PHP 5.6 benchmark result: 33.45 requests / sec
  • Bolt CMS 3.4.8 PHP 7.0 benchmark result: 60.21 requests / sec
  • Bolt CMS # 3.4.8 PHP 7.1 benchmark result: 67.96 requests / sec
  • Bolt CMS # 3.4.8 # PHP 7.2 benchmark result: 72.05 requests / sec?
  • Bolt CMS 3.4.8 hhvm benchmark result: not supported

We can see very good indicators here, every new releasePHPBolt CMSYou can see consistent performance improvements.

Anchor CMS 0.12.6 (pre-release)

AnchorIs a super simple, open source and lightweight blogging system that allows you to focus on writing.
For the benchmark of anchor CMS, we use the free software written by visual idiotDefault theme

  • Number of Posts: 5

Anchor CMS benchmark

Benchmark test results

  • Anchor CMS # 0.12.6 PHP 5.6 benchmark result: 495.33 req / sec
  • Anchor CMS # 0.12.6 PHP 7.0 benchmark result: 546.02 req / sec
  • Anchor CMS # 0.12.6 # PHP 7.1 benchmark result: 565.00 req / sec?
  • Anchor CMS # 0.12.6 PHP 7.2 benchmark result: 561.73 req / sec
  • Anchor CMS # 0.12.6 hhvm benchmark result: 487.71 # req / sec

The test results of PHP 7.1 and PHP 7.2 are very close, but PHP 7.1 performs faster in our performance test

PrestaShop 1.7.2.4

PrestaShopIs a popular and rapidly growing open source e-commerce solution. It was originally released on July 31, 2008, and according to w3techs, its usage rate on the Internet is0.6%

For prestashop benchmark, we use freeTraditional theme。 Please note thatPrestashop does not support hhvm

  • Product quantity: 7 (default sample product)
  • Test URL: / index php
  • Page cache: off, Smarty cache: on

Prestashop benchmark

Benchmark test results

  • Prestashop # 1.7.2.4 PHP 5.6 benchmark result: 61.96 req / sec
  • Prestashop # 1.7.2.4 PHP 7.0 benchmark result: 108.34 req / sec
  • Prestashop # 1.7.2.4 PHP 7.1 benchmark result: 111.38 req / sec
  • Prestashop # 1.7.2.4 # PHP 7.2 benchmark result: 111.48 req / sec?
  • Prestashop # 1.7.2.4 hhvm benchmark result: not supported

The test results were comparable, but PHP 7.2 barely squeezed in to become a leader.

Craft CMS 2.6.3011

Craft CMSIt is a dedicated content management system for developers, designers and web professionals, providing customers with powerful functions of flexibility and ease of use.

For craft CMS benchmark, we use freeDefault theme.

  • Number of articles: 5
  • URL of the test: / index php? p=news
  • Craftcms has its own dockerfile. We customized it to be compatible with nginx.

Craft CMS benchmark

Benchmark test results

  • Craft CMS} 2.6.3011 PHP 5.6 test result: 131.04 requests / sec
  • Craft CMS} 2.6.3011 PHP 7.0 test result: 266.54 requests / sec
  • Craft CMS} 2.6.3011 PHP 7.1 test result: 272.14 requests / sec
  • Craft CMS # 2.6.3011 # PHP 7.2 test result: 280.02 requests / sec?
  • Craft CMS} 2.6.3011 hhvm test result: 26.28 requests / sec

Craft CMS doesn’t perform well on hhvm, but PHP 7.2 is the fastest again.

Fork CMS 5.2.2

Fork is an easy-to-use open source cms using symfony components. For the benchmark of fork CMS, we use the free defaultFork theme。 It should be noted that} fork CMS requires PHP 7.1 or higher environment, and it does not support hhvm.

  • Number of articles: 2 (default sample data from forkcms)
  • Test URL: / modules / blog

Fork CMS benchmark

test result

  • Fork CMS 5.2.2 PHP 5.6 test result: not supported
  • Fork CMS 5.2.2 PHP 7.0 test result: not supported
  • Fork CMS 5.2.2 PHP 7.1 test result: 10.68 requests / sec
  • Fork CMS 5.2.2 PHP 7.2 test result: 12.83 requests / sec?
  • Fork CMS 5.2.2 hhvm test result: not supported

In terms of performance, PHP 7.2 beats PHP 7.1.

Upgrade kinsta to PHP 7.2

If the above results can’t convince you, we don’t know what else. A kind reminder, if you use kingsta client, we released it in December 2017PHP 7.2 。 If you want to see performance improvements, you can easily switch to PHP 7.2 in your mykinsta dashboard.

Switch to PHP 7.2 in kinsta

If you’re worried that it’s not compatible with third-party plug-ins (which can happen), that’s why we use segmented sites.  ? You can try it without worrying about damaging your production environment.

Benchmark test results

You can clearly see from the performance of all php.2 platforms above.?

  • Of the 20 test configurations tested above, 14 can show that PHP 7.2 is the fastest engine. Two of them (Drupal and Magento) do not support PHP 7.2 at present, so there may be 16.
  • As far as WordPress is concerned, PHP 7.2 is the fastest of all tests (stock WordPress site, woocommerce and easy digital downloads).
  • In many benchmark results, you can easily find the performance improvement mode of each new version of PHP released. That’s why it’s very important to test your website, plug-ins, etc. stick to the regular upgrade plan, and your visitors and customers will thank you for the speed they expect!
  • If your hosting provider does not provide an updated version of PHP, you should consider migrating it now.

We are very excited about PHP 7.2 and hope you too! We’d love to hear what you think about our benchmark, and even the experience you’ve upgraded. You can tell us in the comments below.

For discussion, please go to——https://laravel-china.org/top…

Recommended Today

Promoting the construction of computing network makes China have more power in the face of the soaring data increment

Computing network is an original technical concept first put forward in China. It refers to a new information infrastructure that relies on high-speed, mobile, secure and ubiquitous network connection, integrates multi-level computing resources such as network, cloud, digital, intelligence, edge, end and chain, and combines various emerging digital technologies such as AI, blockchain, cloud, big […]