Here at WP Engine we’ve been looking at ways to bring the speed of our HHVM based Mercury platform to even more of our customers. Fortunately, the PHP team has spent the past year (or so) in a speed war with Facebook’s HHVM team.
Zend claims #PHP 7 is faster than #HHVM, with data. Facebook claims HHVM is faster, with data. Either way, your code gets faster. #ZendCon
— Larry Garfield (@Crell) October 20, 2015
According to tests by each respective team, HHVM and PHP 7 have been neck and neck when it comes to the number of raw, uncached hits they’re able to handle. We’re seeing some really impressive numbers out of PHP 7, however.
Now, while I don’t have anything to announce as far as PHP 7 availability goes — it hasn’t even been officially released yet — you can bet that we’re working hard to bring a stable, performant implementation to our customers.
To wet your whistle, let’s take a look at the raw data from a siege test — 25 concurrent users over 5 minutes across 10 randomly selected URLs — run against a basic WordPress (4.3.1) install on our Mercury Vagrant…
PHP 5.5
Transactions: 4354 hits Availability: 100.00 % Elapsed time: 299.64 secs Data transferred: 17.23 MB Response time: 1.21 secs Transaction rate: 14.53 trans/sec Throughput: 0.06 MB/sec Concurrency: 17.59 Successful transactions: 4354 Failed transactions: 0 Longest transaction: 2.04 Shortest transaction: 0.12
HHVM
Transactions: 5256 hits Availability: 100.00 % Elapsed time: 299.53 secs Data transferred: 20.06 MB Response time: 0.92 secs Transaction rate: 17.55 trans/sec Throughput: 0.07 MB/sec Concurrency: 16.12 Successful transactions: 5256 Failed transactions: 0 Longest transaction: 11.54 Shortest transaction: 0.43
PHP 7
Transactions: 11333 hits Availability: 100.00 % Elapsed time: 299.38 secs Data transferred: 44.84 MB Response time: 0.16 secs Transaction rate: 37.85 trans/sec Throughput: 0.15 MB/sec Concurrency: 6.16 Successful transactions: 11333 Failed transactions: 0 Longest transaction: 0.77 Shortest transaction: 0.02
This install was populated with dummy data from WP Test, used Twenty Fifteen for its theme and had Yoast SEO, Contact Form 7, and WordPress Importer active.
As you can see, the number of raw hits that could be handled under HHVM (1.2x faster) was one-upped by the PHP 7 (2.6x faster) implementation. It gets even more exciting when you look at a similar test — 25 concurrent users, 5 minutes, 10 randomly selected URLs — for bbPress…
WordPress (4.3.1) + bbPress (2.5.8)
PHP 5.5
Transactions: 680 hits Availability: 100.00 % Elapsed time: 299.29 secs Data transferred: 3.54 MB Response time: 10.29 secs Transaction rate: 2.27 trans/sec Throughput: 0.01 MB/sec Concurrency: 23.39 Successful transactions: 680 Failed transactions: 0 Longest transaction: 12.39 Shortest transaction: 1.51
HHVM
Transactions: 3194 hits Availability: 100.00 % Elapsed time: 299.41 secs Data transferred: 12.55 MB Response time: 1.84 secs Transaction rate: 10.67 trans/sec Throughput: 0.04 MB/sec Concurrency: 19.67 Successful transactions: 3194 Failed transactions: 0 Longest transaction: 15.37 Shortest transaction: 1.12
PHP 7
Transactions: 4521 hits Availability: 100.00 % Elapsed time: 299.28 secs Data transferred: 23.52 MB Response time: 1.15 secs Transaction rate: 15.11 trans/sec Throughput: 0.08 MB/sec Concurrency: 17.38 Successful transactions: 4521 Failed transactions: 0 Longest transaction: 2.21 Shortest transaction: 0.60
This install was populated with dummy data from EpicWebs bbPress Test Data, used Twenty Fifteen for its theme and had Yoast SEO active.
While HHVM (4.7x faster) presents a fairly significant bump in the number of raw hits it can handle, PHP 7 (6.6x faster) still edges it out in pure performance. This means once we’re ready to make PHP 7 widely available, most customers will see serious performance gains without having to do much more than make sure their plugins, themes, and core install are up to date.
I’m sure if you’ve read this far, you’re probably pretty interested in playing with PHP 7. If so, consider downloading the Mercury Vagrant and testing your current site against the PHP 7 implementation we’ve provided there.
Should installing a Vagrant and testing something on HGV be outside of your comfort zone, I shared some HGV setup and quickstart tips in a presentation I gave at WordCamp Sacramento earlier this month. Feel free to go over my slides if you’d like!
Happy testing!
Jason Cosper works as the Developer Advocate for WP Engine. He loves digging into interesting problems and learning new things. Currently, he spends most of his days getting elbows deep in huge messes and doling out WordPress optimization advice. In his spare time, Cosper enjoys spending time with his wife and very tiny dog, grilling meats, sampling assorted whiskeys, writing cranky tweets about the Lakers and brewing coffee.
Christian says
Can’t wait until PHP7 is implemented. The speed gains are going to be tremendous for WordPress and other CMS’s.
When will WPengine deploy it?
bitedge says
But would this result in faster load times for low traffic sites?
Rene says
When will WPengine deploy PHP7 ?
Janmejai says
Should we switch to PHP7 now?
IS WordPress completely compatible with PHP 7?
Chris Plummer says
I’ll echo the comments above – sounds awesome, when can we get our hands on it?