- Joined
- Oct 23, 2004
- Messages
- 6,613
- Trophies
- 0
- Age
- 34
- Location
- Dar es Salaam
- Website
- vfootball.co.nf
- XP
- 830
- Country
I'm no expert in these matters but Facebook's take on speed and their ability to adept to the growth of its network has always fascinated me.
Among the many strategies that Facebook has 'innovated', Facebook has come up with a new virtual machine that would convert the human readable source code into machine-readable byte code when it is needed.
That is because their current Virtual Machine iteration has a JIT (Just in Time).
How useful is JIT? Check out the latest version of DeSmuME or nds4droid and PPSSPP on the Android and PC (latter).
Technical Bit:
PHP programs are slowly due to PHP being an interpreted language while compiled languages such as C or C++ are faster as they are compiled beforehand into machine language byte code.
The previous iteration (HipHop) used to translate PHP into C++ and produced a considerable speed gain. However with Facebook's ever growing nature, HHVM has been developed that works similar to the Java Virtual Machine (JVM). Java has been considered to be a Hybrid language that converts the human readable source code into machine-readable byte code when it is needed.
PHP driven websites such as Twitter, Wikipedia and Wordpress may potentially benefit from this technology to around 5x its current performance.
SOURCE
GitHub
Among the many strategies that Facebook has 'innovated', Facebook has come up with a new virtual machine that would convert the human readable source code into machine-readable byte code when it is needed.
That is because their current Virtual Machine iteration has a JIT (Just in Time).
How useful is JIT? Check out the latest version of DeSmuME or nds4droid and PPSSPP on the Android and PC (latter).
This JIT approach allows the virtual machine to "make smarter decisions at runtime," Pobar said. For instance, if a call is made to the MySQL database to read a row of data, the HHVM can, on the fly, figure out what type of data it is, such as an integer or a string. It then can generate or call code on the fly that would be best suited for handling this particular type of data.
Technical Bit:
PHP programs are slowly due to PHP being an interpreted language while compiled languages such as C or C++ are faster as they are compiled beforehand into machine language byte code.
The previous iteration (HipHop) used to translate PHP into C++ and produced a considerable speed gain. However with Facebook's ever growing nature, HHVM has been developed that works similar to the Java Virtual Machine (JVM). Java has been considered to be a Hybrid language that converts the human readable source code into machine-readable byte code when it is needed.
Facebook has posted the code for HHVM on GitHub, with the hopes that others will use it to speed their PHP websites as well.
PHP driven websites such as Twitter, Wikipedia and Wordpress may potentially benefit from this technology to around 5x its current performance.
SOURCE
GitHub