Facebook Moves To Just-In-Time Compiler To Serve 800 Million Users Faster

Facebook keeps on growing rapidly with huge number of people signing up daily, heading to 1 billion users. In the mean time, Facebook team is also aware of delivering the fast and better service to their users. To keep up with the pace of increased user base, Facebook moves to HipHop Virtual Machine (hhvm) with Just-In-Time compiler.

Since the beginning, Facebook has used PHP as their server-side scripting language which is best to get adopted. But, when the application gets complex, the performance isn't so well with PHP compared to C/C++. This is the reason Facebook developed and #-Link-Snipped-#, as a free software in late february 2010, to convert the PHP code into optimised C++ and then it can be compiled with g++ to build binary files.

With the help of HipHop for PHP and HipHop interpreter (hphpi), Facebook reported that they reduced their CPU usage to 50% when compared to Apache or PHP. That was great, but they still need to reduce the compile and run time, which was relatively high in their static compiler (HipHop compiler).

This is why they developed this new high level stack-based virtual machine, hhvm by a team of nearly 20 peoples and even released it in GitHub. Using hhvm, they created a dynamic compilation system where the PHP is converted into Abstract Syntax Tree and then into HipHop bytecode (hhbc).

 

#-Link-Snipped-#

This hhbc is then directy consumed by Just-In-Time compiler or interpreters to achieve dynamic compilation. The team working on hhvm is still pushing it hard to reduce the memory use and translation cache to get better performance with low CPU usage. Jason Evans, a software engineer who contributed to this project explained a bit more about hhvm in his #-Link-Snipped-# on Facebook, take a look at it to explore more of hhvm.

Replies

You are reading an archived discussion.

Related Posts

The language developed in early late 1990s and in the previous decade could soon be commanding the future hand held devices. With world speedily moving towards palmtops, iPads and Cell...
In the race of NAND flash memory chips, Hynix has just surpassed Intel and Micron by producing 15nm NAND flash memory, announced during International Electron Devices Meeting (IEDM). The 15nm...
NASA's Mars Rover has made a distinguished discovery of traces of water on Mars with the gypsum found on the planet. Gypsum is a very soft sulfate mineral composed of ...
Rumours suggesting iPad 3 being launched with retina display and higher resolution has been floating around for quite a long time. But it seems that this time Samsung will be...
Matrix Multiplication is an inherent part of maths as well as computer science, like Gaussian elimination, LUP decomposition and the determinant or the inverse of a matrix. Matrix Multiplication algorithms...