HHVM. You might have seen it mentioned here and there but don’t know what it means. Well, let’s get that out of the way right away, shall we?
HHVM stands for HipHop Virtual Machine and is a new way to boost site speed.
How much of a boost? A lot. Like, a really noticeable boost, especially on large sites.
That fact alone has led some platforms to adopt it (Pagely, anyone?) but that might not be convincing enough to developers who value stability above all else. And rightfully so. HHVM is not without its problems.
I recently spoke with a few people well-versed on the HHVM/WordPress connection and what they had to say about it (especially the outlook for developers) is rather interesting.
But first, let’s spend a moment or two going over what HHVM is exactly and why you should care.
An HHVM Origin Story
HHVM got its start in early 2010 as a solution Facebook concocted to deal with the rapid growth of its site. Facebook is PHP-based, and after a lot of work trying to improve its performance, the team created HPHP (HipHop) to “transpile” PHP into C++ code, says David Hayes of Press Up.
This process changes the language of the code before it’s run. Basically, the PHP runs like a native logic operation on your CPU. That means the PHP runs faster and Facebook saw improved site speed as a result. This system wasn’t perfect, of course, which led the Facebook crew to create HipHop Virtual Machine or HHVM. This way, the PHP doesn’t have to be turned into C++ before running, says Hayes. Rather, the code is optimized while it’s running.
Got all that? Good.
But why the sudden interest in running WordPress on HHVM?
People are “hungry for a faster version of PHP,” says Tomas Puig, Senior Director, WP Engine Labs, especially since WordPress 3.9 is HHVM compatible. The fact that its backed by Facebook doesn’t hurt, either. “Just like when you’re tuning cars for performance, people want to tune their websites for ultimate performance,” he says.
Working with HHVM
“Early tests on HHVM for WordPress websites that are very dynamic in nature are incredibly promising,” says Puig. There is a noticeable speed increase when a site is operating under a “heavy load.” And this is really important because sites become more complex and more dynamic by the day.
It’s about “smart content,” Puig says. And that’s why people are so excited about combination of HHVM and WordPress. Its potential is incredibly powerful.
But things aren’t all rosy. Instability and frequent crashes are a real problem for HHVM. To remedy this on the fly, “some people […] have to write automation that tests for uptime every one minute and restart it,” Puig says. And that results in some downtime, as you can imagine.
All of this is to say, HHVM isn’t perhaps ready for production sites just yet, especially when stability and consistent uptime rates are so essential when you’re running a business on your website.
Of course, the HHVM team has been hard at work on a variety of fixes. And that’s good news. But the future of WordPress on HHVM will largely depend on how the WordPress community at large feels about it and whether or not they adopt it, Puig says. “I think it will supplement and not replace the way we do WordPress now on more standard PHP environments.”
Keita Kobayashi, a WordPress plugin developer and programmer, has similar feelings about it. “I don’t think HHVM will ever become an integral part of WordPress development,” he says, citing the fact that HHVM will likely always be viewed as a “second class citizen” when compared to official the PHP interpreter.
But Kobayashi raises an interesting point: If the WordPress Core crew “decides to migrate some code to the Hack language” – which is incredibly unlikely – “HHVM will be required to run WordPress.” An alternative (and more plausible) scenario is this: “If plugin authors decide to use Hack to write their plugin […] then the user will need HHVM to run that particular plugin,” Kobayashi says.
Pros and Cons
The most obvious benefit of using HHVM with a WordPress site is “higher performance,” says Puig. This applies to both users and developers. “Some of the initial tests from our labs team and other developers in the WordPress space show great promise,” he says, noting that “more dynamic sites,” yield particularly impressive results, including any site that must, “render under load such as membership sites.”
Kobayashi agrees, stating that HHVM makes any site that clocks in with average load times into one that loads fast. He’s quick to mention that there are several other factors at play here, including the database, server and site visitor connections, image size, assets, and so forth. “But the initial page load is very important because all other assets depend on that first page,” he says.
So yes. HHVM will make your WordPress site lightning fast. But there are a few drawbacks.
“The biggest drawback to HHVM is the lack of compatibility with the WordPress plugin ecosystem,” Puig says. “While core is running pretty well on it, all the tools you know and love in the ecosystem probably aren’t.” Of course, if more people embrace HHVM and the community around it grows, this will likely not be a long-term issue. But at the moment, anything you want to add or do on top of WordPress Core is the result of “custom development in the HHVM space,” he says.
Developers Are Hesitant for a Reason
As awesome as the site speed boost is, developers aren’t all jumping on board with HHVM just yet – and with good reason.
“It is a very young project in comparison to PHP,” Puig says, “So that’s largely to be expected.” And since HHVM is so new, it’s loaded with “quirks” and bugs that pose hindrances to seamless operation.
But that doesn’t mean it will always be this way. “We believe it can be run in a very stable manner eventually and our team is exploring that right now,” Puig says.
Is the Future Bright for HHVM?
In a word? Yes. But it’s overall success largely depends on whether or not the WordPress community picks it up and gives it a try.
Before the end of our interview, I asked Puig to provide his best prediction: in one year from now, will more developers be hopping on the HHVM bandwagon?
“I think like any tool it has a place (though I’m particularly excited about it),” he says. “More developers will come to the space as the tools and platforms supporting it mature and grow.”
Conclusion
HHVM is getting a lot of buzz right now, and it’s easy to see why. It can make any site super fast. And the promise of lightning speeds for even the biggest, most dynamic sites has many a developer jumping with excitement.
While HHVM isn’t quite there yet in terms of production stability, it’s on its way. And with dedicated developers out there taking the time to test it out, tweak, and fiddle, we might just see more WordPress sites backed by it yet. The more people who adopt it, the greater compatibility across WordPress Core and plugins we’ll see.
Have you tried out HHVM yet? Thinking about it? I’d love to hear your thoughts below!
Clyde
I’m running WordPress 4.4.2 on HHVM. There are a lot of ghost problems when it comes to running various plugins and page builders…I’m changing to php 5.5. I think HHVM isn’t worth the trouble.
Jose Freitas
Great article. In the portuguese WordPress community website we published, on February, 27, some tests that Luís Rodrigues, Solutions Architect & Business Developer, did using HHVM with WordPress. The post (http://wp-portugal.com/2014/02/27/wordpress-e-hiphop-virtual-machine/) is in portuguese but i’m sure you’ll be able to understand it after Google Translate.
Zach Russell
I think I can agree with about every other comment here HHVM is AMAZING!!! when it comes to speed improvements. I am seeing response times that I wouldn’t even dream of (.o7s time to first byte, with caching) on FPM. It definitely isn’t ready for production, however.
I was working on a client site (and testing HHVM) where certain pages were crashing and I couldn’t figure out why. Turns out that HHVM didn’t implement the imagettftext() function (native PHP function) which was used by Really Simple CAPTCHA plugin. I think that if HHVM does a one-to-one implementation of all PHP functions it could potentially be a replacement for the default PHP interpreter, and make PHP more attractive again for many apps (instead of Rails, Node, Django, etc..)
Mark Gavalda (@MarkGavalda)
We’ve been offering HHVM to clients for a couple of months now ( https://kinsta.com/blog/hhvm-and-wordpress/ ) and based on our experience we have mixed feelings about HHVM right now. On the pro side there’s the incomparable speed boost but on the other hand the incompatibility issues and the unexpected segmentation faults without a proper restart mechanism is annoying. Our dev team has been helping the HHVM guys (who do an amazing job btw, and we really appreciate all their efforts to make HHVM available as an open source project for the whole PHP community) sort a couple of issues that arose from the use of it with WordPress and will continue to do so in the future.
alam
I’m using latest hhvm for WordPress 3.9.1 . Initial load takes time (first 5 load I guess) then the rest is fly. I still monitor it for another month. But so far its work well without wp super cache.
David Hayes
This is a pretty good article, and I can say that because I unwittingly wrote a bunch of it.
I have to say I’m pretty disappointed that it seems to rely quite heavily, and in many places quotes exactly without citation my recent blog post on our consultancy’s blog about the HHVM. My original post is at: http://pressupinc.com/blog/2014/06/what-is-the-hhvm/.
I hope that this post’s author and ManageWP will consider their actions and do something to rectify the situation. A citation link, at a minimum, would be great to see.
Brenda Barron
Hi David,
My sincerest apologies. There was a miscommunication with my research assistant who did not properly quote or cite some research notes she compiled for me. I’ve gone back through the article and made many edits as well as added citation to your article. Again, this was not intentional and I’m so sorry for causing you distress. Rest assured, this will not happen again and I appreciate you bringing this to my attention.
David Hayes
Thanks, Brenda. The change is welcome. I do have to say that it still feels an awful lot like my article with things rephrased rather than an original article citing mine, but I recognize you can’t win them all. I’d love to see an original take on the topic here on the ManageWP blog (which was the reason I noticed the article in the first place), but I think turning this into that is probably impossible.
Brenda Barron
Hi David — I’ll see what I can do in the a.m. Mostly, I wanted to address the lack of citations tonight as that is unacceptable. I’ll drop you a line when I’ve had some time to do additional research to ensure this piece offers a unique perspective. Thanks again for your understanding.
Brenda Barron
Hi David, I just wanted to let you know that the article has been completely rewritten. I’ve referenced your article in one of the opening paragraphs but the rest is all new. Is there anything else that we can do to help fix this mess? I’m still so sorry that this happened in the first place.
David Hayes
Hi Brenda, thanks for doing the rewrite. I have to say I’m rather impressed with this version of the article. It’s what I hoped I’d find when I first clicked through. I’d not really experimented with using the HHVM with WordPress, and between the comments and the quotes in the article I feel like I have a much clearer picture of where it stands today. Kudos!
Brenda Barron
You’re very welcome! I’m so glad you’re pleased. At the end of the day, this has motivated us to do better and to be better. Best to you!
Maarten
I’m using HHVM as PHP backend for my nginx webserver. Before HHVM, I used php-fpm with APC and Memcached cache for WordPress. With plugins I managed to make my website quicker, but every change of code required me to empty the cache. This resulted in a slow website for a few seconds because the cache had to be loaded.
With HHVM, I removed all the caching plugins and I simply let HHVM do the job, and it’s even quicker then my former setup.
Brenda Barron
That’s awesome, Maarten! I’m excited to see what happens as even more people try out HHVM with their WordPress sites.