HHVM Detailed Introduction
HipHop VM (HHVM) is a virtual machine launched by Facebook to execute PHP code, which is a PHP JIT (just-in-time) compiler with the advantage of generating fast code and instant compilation.
Facebook says HHVM will replace HPHPI for all PHP execution. According to Facebook, HHVM has made significant improvements in speed, 60% faster than the PHP interpreter currently in use, while using 90% less memory.
Facebook published a blog post in early December 12 announcing that their explanatory PHP runtime environment, HHVM (HipHop VM), has reached or exceeded the HipHop of the compiled PHP runtime environment.
HHVM is built on the basis of HPHPC, which translates PHP code into high-level bytecode (an intermediate language), which translates these bytecode into machine code at run time (JIT) compilers.
Here are some concepts about bytecode, machine code, and just-in-time (JIT) compilers, and quickly explore the following concepts to clarify the role of these concepts in HHVM.
Bytecode: A code that human beings cannot read and are designed to perform efficiently for compilers. When HHVM loads the project for the first time, it converts all of the PHP code into bytecode, and bytecode generation is platform-independent.
Machine code: is a series of instructions for CPU execution. The use of the Assembly should be clear machine code, it is estimated that no one likes to use assembly programming. The compiler can then turn the assembly into machine code, which is then processed by the CPU.
JIT (Instant) Compiler: Instant compilation is a software optimization technique that compiles bytecode at run time. The bytecode is stored in memory, and the JIT compiler loads and compiles the bytecode as needed.
Through the above technologies, hiphop and HHVM have achieved improved performance.
Recently, HHVM has almost fully supported PHP 5.4, but there are still many bugs, so not all applications can run. As a result, Facebook is ready to let the 20 most popular open source PHP projects run on HHVM. The first project that has been supported is WordPress
HHVM 3.0 release, execute PHP virtual machine