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.

Latest Linux Hardware Reviews
  1. Mini-Box M350: A Simple, Affordable Mini-ITX Case
  2. Overclocking The AMD AM1 Athlon & Sempron APUs
  3. AMD Athlon 5350 / 5150 & Sempron 3850 / 2650
  4. Upgraded Kernel & Mesa Yield A Big Boost For Athlon R3 Graphics
Latest Linux Articles
  1. Ubuntu 12.04.4 vs. 13.10 vs. 14.04 LTS Desktop Benchmarks
  2. AMD OpenCL Performance With AM1 Kabini APUs
  3. A Quick Look At GCC 4.9 vs. LLVM Clang 3.5
  4. Are AMD Athlon/Sempron APUs Fast Enough For Steam On Linux?
Latest Linux News
  1. Ubuntu 14.04 LTS "Trusty Tahr" Officially Released
  2. Ubuntu 12.04 LTS vs. 14.04 LTS Server Benchmarks
  3. QEMU 2.0 Released With ARM, x86 Enhancements
  4. Running The Unity 8 Preview Session On Ubuntu 14.04 LTS
  5. R600 Gallium3D Disables LLVM Back-End By Default
  6. Fedora 21 Gets GNOME 3.12, PHP 5.6, Mono 3.4
  7. Fedora Workstation Is Making Me Quite Excited
  8. Maynard: A Lightweight Wayland Desktop
  9. Chromium Browser Going Through Growing Pains In Ubuntu 14.04
  10. KDE 4.13 Is Being Released Today With New Features
  11. Trying Out Radeon R9 290 Graphics On Open-Source
  12. Intel Broadwell GT3 Graphics Have Dual BSD Rings
Latest Forum Discussions
  1. After Jack Keane, RuseSoft will briing Ankh 3 to Linux through Desura
  2. Updated and Optimized Ubuntu Free Graphics Drivers
  3. Suspected PHP Proxy Issue
  4. Linux Kernel Developers Fed Up With Ridiculous Bugs In Systemd
  5. The GNOME Foundation Is Running Short On Money
  6. Change installation destination from home directory
  7. Bye bye BSD, Hello Linux: A Sys Admin's Story
  8. New tool for undervolt/overclock AMD K8L and K10 processors