1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Memory
  5. Motherboards
  6. Processors
  7. Software
  8. Storage
  9. Operating Systems


Facebook RSS Twitter Twitter Google Plus


Phoronix Test Suite

OpenBenchmarking.org

Facebook's HipHop 2.0 Virtual Machine Is Very Fast

Free Software

Published on 09 April 2013 04:51 AM EDT
Written by Michael Larabel in Free Software
18 Comments

Released last month by Facebook was their open-source HipHOp "HHVM" 2.0 virtual machine. Benchmarks of HHVM at Phoronix show that the code does live up to Facebook's performance claims.

For several years now Facebook has been experimenting with making PHP faster through various techniques. Facebook heavily relies upon the PHP server-side scripting language and for handling their immense traffic, they need PHP to be as fast as possible.

The original HipHop (HPHPc) transformed PHP source-code into C++ that was then passed into GCC for producing a native, system binary. Eventually, work turned to HipHop's HHVM, which is a virtual machine that compiles PHP source code into a Bytecode that is then run on a virtual machine or compiled to system code using a custom JIT compiler. HHVM is the technique Facebook currently uses for their site and is now their primary focus of HipHop.

With the HipHop 2.0 PHP release from last month, they killed off the older HPHPc compiler and are focusing on just HHVM. Released later on in March was HipHop 2.0.1 with bug-fixes.

For anyone interested in more details on Facebook's HipHop/HHVM see their GitHub Wiki page.

With the upcoming release of PHP 5.5, yesterday I delivered performance benchmarks of PHP 5.5 when compared to the older PHP 5.4, 5.3, and 5.2 stable branches. Using the same test case (phoronix-test-suite debug-self-test; see the aforelinked article for more test details), I checked to see how HipHop 2.0.1 performed from the Apple MacBook Pro with Intel Core i5 CPU running Ubuntu 12.04.2 LTS.

The same system hardware and software running the same test and the same code was pushed through Facebook's HipHop 2.0.1 HHVM. The results are outright impressive:
PHP 5.3.3.hiphop
DETAILED_SYSTEM_INFO:          0.121 seconds
LIST_AVAILABLE_TESTS:          0.348 seconds
LIST_AVAILABLE_SUITES:         42.185 seconds
INFO:                          0.029 seconds
CLONE_OPENBENCHMARKING_RESULT: 30.419 seconds
RESULT_FILE_TO_TEXT:           0.009 seconds
DIAGNOSTICS:                   0.005 seconds
DUMP_POSSIBLE_OPTIONS:         0.004 seconds

ELAPSED TIME:                  219.362 seconds
PEAK MEMORY USAGE:             0.871 MB
PEAK MEMORY USAGE (emalloc):   4 MB

The total test time was now just 219 seconds compared to the 509 seconds needed for PHP 5.4 or 540 seconds for the upcoming PHP 5.5 release. Using HHVM rather than upstream PHP was significantly faster for this very real-world workload, which is made up of PHP objects, file I/O, zip/tar.gz file compression, PHP string functions, and other common core PHP calls.

The most user-facing area where Facebook's PHP engine was significantly faster was with the clone-openbenchmarking-result sub-command, which is largely made-up of calls to pts_Graph, the Phoronix Test Suite PHP library for rendering SVG graph files. The graph rendering is computationally complex and does use the PHP DOM (Document Object Model) along with other common PHP string functions.

In terms of the peak memory usage, the HHVM numbers were very low, but it seems likely that HHVM isn't implementing the memory_get_peak_usage() function, so it's simply the times for what's being looked at here.

Overall, the performance of HipHop HHVM is very impressive compared to PHP 5.5/5.4/5.3/5.2. In my internal tests I have also found that HHVM is also much faster on another one of my unreleased code-bases.

In terms of pushing code through HHVM compared to upstream PHP, it's quite comparable to PHP 5.3 support. When initially "porting" the Phoronix Test Suite to handle running on HHVM, there were just a few differences mostly coming down to HHVM having some semantic PHP CURL differences for file downloading, adding comments to a PHP DOM object yields differences between PHP and HHVM, and HHVM has no plans to implement the get_defined_constants() call.

Those are the only issues I recall, which were easily worked around within the Phoronix Test Suite Git code-base. The other code-base I tested against HHVM had no problems at all compared to where it normally runs on PHP 5.3.

Overall, Facebook's HipHop HHVM has been working very nicely throughout my internal testing and evaluation.

About The Author
Michael Larabel is the principal author of Phoronix.com and founded the web-site in 2004 with a focus on enriching the Linux hardware experience and being the largest web-site devoted to Linux hardware reviews, particularly for products relevant to Linux gamers and enthusiasts but also commonly reviewing servers/workstations and embedded Linux devices. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics hardware drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated testing software. He can be followed via and or contacted via .
Latest Linux Hardware Reviews
  1. AMD Launches New FX CPUs, Cuts Prices On Existing Processors
  2. Preview: AMD's FX-9590 Eight-Core At Up To 5.0GHz On Linux
  3. Intel Launches The Core i7 5960X, Mighty Powerful Haswell-E CPUs
  4. AMD Radeon R9 290: Gallium3D vs. Catalyst Drivers
Latest Linux Articles
  1. LLVM Clang 3.5 Brings Some Compiler Performance Improvements
  2. Ondemand vs. Performance CPU Governing For AMD FX CPUs On Linux 3.17
  3. How Intel Graphics On Linux Compare To Open-Source AMD/NVIDIA Drivers
  4. The Fastest NVIDIA GPUs For Open-Source Nouveau With Steam Linux Gaming
Latest Linux News
  1. POCL Is Maturing Well For Running OpenCL On The CPU
  2. New Group Calls For Boycotting Systemd
  3. The Features To Find With The Imminent Release Of LLVM/Clang 3.5
  4. Borderlands 2 Is Coming To Linux
  5. The Witcher 2 Ups The Performance More & Works Around Catalyst Bug
  6. Running Gallium3D's LLVMpipe On The Eight-Core 5GHz CPU
  7. Trying Intel OpenCL On Linux For Video Encoding
  8. GSoC 2014 Yielded Some Improvements For Mesa/X.Org This Year
  9. webOS Lives On As LuneOS With New Release
  10. Marek Lands Radeon Gallium3D HyperZ Improvements
Latest Forum Discussions
  1. Lennart Poettering Talks Up His New Linux Vision That Involves Btrfs
  2. nv and xorg.conf under Debian PPC
  3. AMD graphics doesn't work with AMD Catalyst drivers
  4. Best Radeon for a Power Mac G5?
  5. The dangers of Linux kernel development
  6. Updated and Optimized Ubuntu Free Graphics Drivers
  7. AMD Releases UVD Video Decode Support For R600 GPUs
  8. SSD seems slow