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. Even With Re-Clocking, Nouveau Remains Behind NVIDIA's Proprietary Linux Driver
  2. The Power Consumption & Efficiency Of Open-Source GPU Drivers
  3. AMD R600g/RadeonSI Performance On Linux 3.16 With Mesa 10.3-devel
  4. Intel Pentium G3258 On Linux
Latest Linux Articles
  1. AMD Catalyst 14.6 Does Slightly Better With APITest OpenGL Tests
  2. Updated Source Engine Benchmarks On The Latest AMD/NVIDIA Linux Drivers
  3. Nouveau vs. Radeon vs. Intel Tests On Linux 3.16, Mesa 10.3-devel
  4. KVM Benchmarks On Ubuntu 14.10
Latest Linux News
  1. Belkin's WRT54G Router Successor Is Crap On The Software Front So Far
  2. QEMU 2.1 Officially Released
  3. XBMC Is Being Renamed To "Kodi"
  4. SteamOS Beta 126 Better Handles XBMC
  5. Ubuntu 14.10 Alpha 2 Released
  6. KDE 4.14 Release Candidate Ships
  7. Drivers & Drama Dominated Linux Talk In July
  8. Fedora Assembles A Security Team
  9. AMD Launches The A10-7800, The 65 Watt Kaveri
  10. Builder: A New Development IDE Being Built For GNOME
Latest Forum Discussions
  1. AMD Launches The A10-7800, The 65 Watt Kaveri
  2. Grand Theft Auto Running On Direct3D Natively On Linux Shows Gallium3D Potential
  3. Updated and Optimized Ubuntu Free Graphics Drivers
  4. Linus Torvalds On GCC 4.9: Pure & Utter Crap
  5. Updated graphics drivers for Ubuntu 12.04 Precise LTS
  6. Debian + radeonsi
  7. AMD Publishes Open-Source Linux HSA Kernel Driver
  8. Open-source drivers on ATI R7 260X