PHP 7 vs HHVM: Which Runtime Delivers Faster Web Performance?
This article compares PHP 7 and HHVM, explaining their origins, how they parse and execute code, presenting benchmark results for WordPress and Drupal, listing companies that use HHVM, and discussing future prospects to help developers choose the best backend runtime.
What is HHVM?
In 2008 Facebook started a project to convert PHP scripts to C++ to run on web servers, aiming to save resources. The effort succeeded, allowing servers to handle five to six times more requests.
By 2010, with increased demand, Facebook developed HHVM.
HHVM uses Just-In-Time (JIT) compilation to turn PHP code into bytecode, then into optimized machine code for faster execution.
What is PHP 7?
PHP 7 is the community’s response to HHVM, claiming up to 100% performance improvement over PHP 5. PHP 6 was abandoned, so the next major release was named PHP 7.
The real comparison of interest is between PHP 7 and HHVM, as many experts have benchmarked both.
PHP 7 vs HHVM: Similarities and Differences
Code parsing : PHP 7 uses the standard PHP parser to generate HTML directly, while HHVM first compiles PHP to HipHop bytecode, then to machine code with optimizations.
Writing code : Both accept PHP code, but HHVM requires installation and command‑line invocation.
Performance tests : HHVM was faster than earlier PHP versions, but recent tests show PHP 7 can be slightly faster in some cases. Kinsta’s benchmark results include:
WordPress 4.1.1: PHP 7 handles over twice the requests per second of PHP 5.6, but HHVM 3.6.1 reaches 624 rps versus PHP 7’s 604 rps.
Drupal 8: PHP 7 outperforms HHVM by more than 37%.
Companies Using HHVM
Beyond Facebook, Wikimedia and Etsy run PHP applications on HHVM.
Wikimedia reduced CPU load from 50% to 10% and halved response times after deploying HHVM.
Etsy observed HHVM handling 280 requests per second, while PHP 5.4 struggled beyond 190 rps.
Future of PHP 7 and HHVM
PHP 7 stable release was scheduled for November 2015; its promising benchmarks attract adoption. HHVM’s future is uncertain—while some enterprises still use it, many consider switching back to PHP 7 due to comparable performance and easier deployment.
Facebook continues HHVM development, recently adding macOS support, and believes HHVM can still outperform PHP 7 in many scenarios, including WordPress.
Why HHVM and PHP 7 Compete for E‑commerce Sites
Shop owners must choose based on their platform; for WordPress sites, benchmark results help decide which solution reduces page load time, server response time, and CPU usage.
Reasons to choose HHVM
Dynamic translation often yields higher performance for WordPress.
Low memory usage per request under heavy load.
Supports latest WordPress and many PHP frameworks.
Open‑source and modifiable.
Reasons to choose PHP 7
In some cases, such as Drupal 8, PHP 7 is faster.
No need to install HHVM.
Existing PHP 5 code runs smoothly after upgrade.
Backed by the long‑standing PHP community.
Make Your Choice
Kinsta recommends selecting either PHP 7 or HHVM promptly to optimize site performance and protect reputation.
Original title: PHP 7 vs. HHVM Comparison Source: https://dzone.com/articles/php-7-vs-hhvm-comparison Translator: Open Source China
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
