Last night, we reported that Facebook was planning to release a JIT compiler for PHP, a huge step toward making the PHP runtime - and PHP-based sites and apps - faster by taking the interpreted lagnuage (a.k.a., more human-readable code) a few steps closer to the bare-metal ones and zeros machines actually read.
We've been updated this morning that the PHP runtime has in fact been rewritten, with an extra step: The PHP is translated to C++ (a more machine-readable language) which is then compiled with g++. This project, called HipHop, has been in development under great secrecy at Facebook for the past couple years and has just this morning been open sourced.
Facebook engineer Haiping Zhao writes, "With HipHop we've reduced the CPU usage on our Web servers on average by about fifty percent, depending on the page. Less CPU means fewer servers, which means less overhead."
We're sure this is good news for Facebook's brand new data center, still under construction.
"HipHop executes the source code in a semantically equivalent manner," Zhao continues, "and sacrifices some rarely used features - such as eval() - in exchange for improved performance."
He also notes that while interpreted languages such as PHP, Ruby and Python - the launguages that, by and large, rule the web of apps and social site we all use today - allow for huge strides in developer productivity, they are also less efficient and often simply slower in runtime. For a huge and ever-growing site such as Facebook, this might have eventually led to scalability issues.
In other words, it cost Facebook less to create a faster PHP runtime than to buy all the servers that would be needed to support hundreds of millions of users without a faster runtime.
We will update this post as news continues to break.
Discuss
http://bit.ly/9O3nze
No comments:
Post a Comment