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. NVIDIA GeForce GTX 970 Offers Great Linux Performance
  2. CompuLab Intense-PC2: An Excellent, Fanless, Mini PC Powered By Intel's i7 Haswell
  3. From The Atom 330 To Haswell ULT: Intel Linux Performance Benchmarks
  4. AMD Radeon R9 285 Tonga Performance On Linux
Latest Linux Articles
  1. 6-Way Ubuntu 14.10 Linux Desktop Benchmarks
  2. Ubuntu 14.10 XMir System Compositor Benchmarks
  3. Btrfs RAID HDD Testing On Ubuntu Linux 14.10
  4. Ubuntu 14.10 Linux 32-bit vs. 64-bit Performance
Latest Linux News
  1. openSUSE Factory & Tumbleweed Are Merging
  2. More Fedora Delays: Fedora 21 Beta Slips
  3. Mono Brings C# To The Unreal Engine 4
  4. Coreboot Now Has Support For Intel Broadwell Hardware
  5. Enlightenment's EFL 1.12 Alpha Has Evas GL-DRM Engine, OpenGL ES 1.1 Support
  6. GTK+ Lands Experimental Backend For Mir Display Server
  7. Ubuntu 14.10 Officially Released
  8. Mesa 10.4 Might Re-Enable HyperZ For R600g/RadeonSI
  9. Intel GVT-g GPU Virtualization Moves Closer
  10. GTK+ 3.16 To Bring Several New Features
Latest Forum Discussions
  1. Updated and Optimized Ubuntu Free Graphics Drivers
  2. Linux hacker compares Solaris kernel code:
  3. HOPE: The Ease Of Python With The Speed Of C++
  4. Advertisements On Phoronix
  5. Users/Developers Threatening Fork Of Debian GNU/Linux
  6. Ubuntu 16.04 Might Be The Distribution's Last 32-Bit Release
  7. AMD Releases UVD Video Decode Support For R600 GPUs
  8. Proof that strlcpy is un-needed