HipHop for PHP

HipHop for PHP is a free software that originally compiled PHP scripts for the purpose of performance enhancement to C source code, which then - is translated into each required machine language - usually by g . It is now available with HHVM a virtual machine for hip-hop.

It is therefore an alternative PHP implementation, but so far only provides the PHP 5.3 language support. PHP is currently available in version 5.5.

HipHop before HHVM

The original HipHop compiler HPHPc converted PHP code into C code. Through the compilation significantly higher execution speeds or lower processor loads are achieved than with interpreting the PHP scripts, for example through the Zend Engine, in which the translation of the instructions should be in the machine language, at least in part, for any use again.

There a natively executable program file was created so that also contains the web server the same time and thus answer itself directly to HTTP requests and, for example, made ​​the Apache Web server unnecessarily.

In contrast to other approaches to increase the execution speed of PHP HipHop brought a significant further increase in speed up to a factor of 6, and reduced memory usage - among other things, as this parallel server requests were not processed in separate processes with corresponding separate storage areas. This can cause significant performance improvements or resource savings for sites with very high visitor numbers.

HipHop is distributed as free software with source code under version 3.01 of the PHP license. The source code contains more than 300,000 lines of C and C.

HPHPc support PHP in version 5.3. In the development version HPHPd that interprets rather than compiled, which had to be omitted some rarely used features such as the dynamic PHP language features eval () and create_function () on principle, HipHop could not reach this speed records.

HHVM

Because of the various limitations of the foreseeable development version HPHPd started Facebook in 2010 to investigate an alternative approach. In this case, PHP is running in a virtual machine, the HHVM. HHVM transmits PHP code into an abstract bytecode ( called Intermediate Language ). This bytecode is then dynamically translated at runtime into x64 machine language by a JIT compiler. This is similar to the approach of the virtual machines from other languages ​​such as Java (JVM ) and C # (CLR ) or with Microsoft's language-independent intermediate language for the. Net platform.

HHVM not yet supported in July 2013, all features of PHP 5.4, but PHP 5.3 goes out. The end of 2012 HHVM reached the speed of HPHPc

Beginning of 2013 changed the operation of Facebook HPHPc on HHVM. This HPHPc were replaced for the real operation and HPHPd for the test mode.

History

HipHop was originally developed at Facebook, led by Zhou Haiping on CentOS and Fedora systems. It follows previous similar designs as phc and Roadsend PHP compiler ( compile to C) or Quercus and Project Zero ( Java implementations of PHP) or Phalanger (compiler for. NET). It was probably more than two years in development, before the publication was announced as free software under the PHP license for February 2, 2010. The date was due to technical problems can not be complied with, but on February 20, then landed the source code as promised in the Git repository. The software is on Facebook for the handling of hundreds of millions of users in use. In the following months was working on further acceleration of hip hop and support for some of the new features of PHP 5.3 implemented. Furthermore, porting to 32 -bit platforms has been implemented by Hui Chen as part of a Google Summer of Code grant.

392828
de