PHP + HHVM Benchmark 2018

Each year we try and take a deep dive into performance benchmarks across various platforms and see how different versions of PHP and HHVM stack up against each other. This year we went all out and benchmarked four different PHP engines and HHVM across 20 different platforms/configurations. We also tested popular eCommerce solutions such as WooCommerce.

We are always encouraging WordPress users to take advantage of the latest supported versions of PHP. Not only are they more secure, but they offer additional performance improvements. We aren’t talking just about WordPress either, this true for the most part across all platforms. We’ll show you today how PHP 7.2 knocks the socks off of everything we put it against!

The results this year have drastically changed from our previous benchmarks where HHVM was the winner. We now are excited to see PHP 7.2 as the leading engine in terms of speed. It’s important to note that as far as WordPress is concerned, HHVM is no longer supported and will slowly be fading away. We no longer encourage our customers to move to HHVM and also noticed support for it across various platforms was subpar as well.

This is great news for developers and end-users alike as it means more of a focus back on PHP and providing faster websites and web services for everyone.

PHP & HHVM Benchmarks (2018)

For each test, we used the latest version of each platform and benchmarked the home page for a minute with 15 concurrent users. Below are the details of our test environment.

  • Machine used: 8x Intel(R) Xeon(R) CPU @ 2.20GHz (Powered by Google Cloud Platform and running in an isolated container)
  • OS: Ubuntu 16.04.3 LTS
  • Docker Stack: Debian 8, Nginx 1.13.8, MariaDB 10.1.31
  • PHP Engines: 5.6, 7.0, 7.1, 7.2
  • HHVM: 3.24.2
  • OPCache: For WordPress, Joomla, and Drupal, we used the official Docker image. For the rest we used the same image setup with the OPcache enabled using the following recommended php.ini settings.
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

What is PHP?

PHP stands for Hypertext Preprocessor. It is one of the most popular scripting languages on the web today. According to W3Techs, PHP is used by over 83% of all the websites who use a server-side programming language.

What is HHVM?

Due to performance issues with PHP the team at Facebook developed the HipHop Virtual Machine (HHVM). It is a system that uses just-in-time (JIT) compilation to convert PHP code into a machine language to establish a synergy between the PHP code and the underlying hardware that runs it.

Platforms and Configurations Tested

Our tests include the following 20 platforms/configurations. On some, we had to test multiple versions due to the lack of support for a specific PHP version. Click on one below to skip directly to its test notes and results. The data is measured in requests per second. The more requests the better.

  • WordPress 4.9.4
  • WordPress 4.9.4 + WooCommerce 3.3.1

WordPress 4.9.4


The first platform we tested was, of course, one of our favorites: WordPress (we might be a little biased being that we live and breath this CMS on a daily basis ????). At its core, WordPress is open-source software you can use to create a beautiful website, blog, or app. In fact, WordPress powers over 29% of all the websites on the internet. Yes – more than one in four websites that you visit are likely powered by WordPress.

WordPress CMS

For the WordPress benchmark, we utilized the free Twenty Seventeen theme. We used dummy content from wptest.io and benchmarked the home page for a minute with 15 concurrent users.

  • Number of Posts: 10 / page generated with wptest.io
  • “Search” sidebar is the only thing present on the Sidebar
  • Docker Image is derived from https://hub.docker.com/_/wordpress/

Benchmark Results

  • WordPress 4.9.4 PHP 5.6 benchmark results: 49.18 req/sec
  • WordPress 4.9.4 PHP 7.0 benchmark results: 133.55 req/sec
  • WordPress 4.9.4 PHP 7.1 benchmark results: 134.24 req/sec
  • WordPress 4.9.4 PHP 7.2 benchmark results148.80 req/sec ????
  • WordPress 4.9.4 HHVM benchmark results: 144.76 req/sec

PHP 7.2 was the winner, proving to be slightly faster than HHVM. This is a significant change from our benchmarks in 2016 where HHVM was clearly the winner. PHP for WordPress is also a lot more stable. We have experienced first-hand many issues with HHVM. And if you compare PHP 7.2 to PHP 5.6, it can handle 3x as many requests (transactions) per second!

WordPress 4.9.4 + WooCommerce 3.3.1


WooCommerce is a fully customizable, open-source eCommerce platform built for WordPress. It’s also by far, one of the most popular eCommerce solutions, powering over 42% of all eCommerce sites on the internet.

WooCommerce

For this next test, we took WordPress along with WooCommerce installed. We utilized the free Storefront eCommerce theme.

WordPress + WooCommerce benchmarks

Benchmark Results

  • WordPress 4.9.4 + WooCommerce 3.3.1 PHP 5.6 benchmark results: 34.47 req/sec
  • WordPress 4.9.4 + WooCommerce 3.3.1 PHP 7.0 benchmark results: 84.89 req/sec
  • WordPress 4.9.4 + WooCommerce 3.3.1 PHP 7.1 benchmark results: 86.04 req/sec
  • WordPress 4.9.4 + WooCommerce 3.3.1 PHP 7.2 benchmark results: 92.60 req/sec ????
  • WordPress 4.9.4 + WooCommerce 3.3.1 HHVM benchmark results: 69.58 req/sec

WooCommerce struggled with HHVM, and PHP 7.2 beat out PHP 7.1 by a small margin.

In Conclusion

As you can clearly see from the tests above, PHP 7.2 is leading the rating. PHP 7.2 was the fastest in all tests..

In many of the benchmark results, you can easily spot a pattern of increased performance with each new version of PHP that is released. This is why it’s so important to test your site, plugins, etc. and stick to a regular upgrade schedule. Your visitors and customers will thank you as they expect speed!

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!