Saturday, 22 March 2014

What is HHVM?

HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP. HHVM uses a just-in-time (JIT) compilation approach to achieve superior performance while maintaining the development flexibility that PHP provides.

HHVM runs much of the world’s existing PHP. The HHVM team, along with many wonderful community members, has made it a stated, high priority goal to run all existing PHP code existing out in the wild.

What are the HHVM Features ...
  • The Hack Language
  • JIT Compilation
  • HNI
  • FastCGI support
  • Increasing PHP5 Parity
  • hphpd debugger
  • and much more
One of the strongest and most significant features in HHVM is its support for a wide range of databases. Writing a database-enabled web page is incredibly simple using one of the database specific extensions (e.g., for mysql), or using an abstraction layer like PDO, or connect to any database supporting the Open Database Connection standard via the ODBC extension. Other databases may utilize cURL or sockets.

Rather than directly interpret or compile PHP code directly to C++, HHVM compiles Hack and PHP into an intermediate bytecode. This bytecode is then translated into x64 machine code dynamically at runtime by a just-in-time (JIT) compiler. This compilation process allows for all sorts of optimizations that cannot be made in a statically compiled binary, thus enabling higher performance of your Hack and PHP programs.

To date, HHVM (and its predecessor HPHPc before it) has realized over a 9x increase in web request throughput and over a 5x reduction in memory consumption for Facebook compared with the PHP 5.2 engine + APC.

There are two main areas where HHVM scripts are used.
  • Server-side scripting : This is the most traditional and main target field for HHVM. You need three things to make this work. The HHVM parser, a web server and a web browser. You need to run the web server, with a connected HHVM installation. You can access the Hack program output with a web browser, viewing the Hack page through the server. All these can run on your home machine if you are just experimenting with Hack programming. See the installation instructions section for more information on how to install HHVM.
  • Command line scripting : You can make an HHVM script to run it without any server or browser. You only need the HHVM parser to use it this way. This type of usage is ideal for regularly executed scripts or testing new libraries and functionality. These scripts can also be used for simple text processing tasks. See the section about Command line usage of HHVM for more information.
Official Site:
OpenSource :


Post a Comment