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.”
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!