Facebook unveiled the big speed of the HipHop PHP program

Source: Internet
Author: User
High programming efficiency is the biggest feature of PHP, but as a script language, there has always been a problem of low CPU and memory usage efficiency until the emergence of hiptoo forphp. Facebook's mysterious PHP project hipster forphp was unveiled. This project consists of a conversion program from PHP to C ++, a re-implemented PHP runtime library, and many frequently used PHP extensions to rewrite the version. it aims to accelerate and optimize PHP. Faceb programming efficiency is the biggest feature of PHP, but as a scripting language, there has always been a problem of low CPU and memory usage efficiency until the emergence of HipHop for PHP. Facebook's mysterious PHP project HipHop for PHP was unveiled. This project consists of a conversion program from PHP to C ++, a re-implemented PHP runtime library, and many frequently used PHP extensions to rewrite the version. it aims to accelerate and optimize PHP.

Zhao Haiping, project leader at the official Facebook blog (not directly accessible), said that the HipHop project has a huge impact on Facebook, in the words of his Ph.D. in computer science at Princeton, 1987 Institute. It currently supports 90% of Facebook's Web traffic. Because of HipHop, the average CPU usage on Facebook Web servers is reduced by 50%, which greatly reduces the server requirements. To make this improvement benefit the community, they decided to make it open-source, hoping to further help improve the scalability of more large and complex PHP websites.

PHP and Facebook problems

As we all know, Facebook's front-end is mainly written in PHP. Zhao Haiping said Facebook has benefited a lot from the development of PHP in the past six years. PHP is very simple, easy to learn, and easy to use, so new engineers have grown fast, facilitating Facebook's faster innovation.

PHP is a scripting language. it features high programming efficiency and supports fast iteration of products. However, compared with the traditional compilation language, the CPU and memory usage of the script language is not efficient. With the wide adoption of Ajax technology and the high requirement of SNS on dynamics, these shortcomings are even more prominent. For Facebook, which has more than 400 billion PVS per month, how to scale is particularly challenging.

A common method is to directly use C ++ to rewrite the complicated part of the PHP application and use it as a PHP extension. In fact, PHP is transformed into a glue language that connects the front-end HTML and C ++ application logic. From a technical point of view, this is no problem, but with the increase in skill requirements, the number of engineers who can work on the entire application is greatly reduced. Learning C ++ is only the first step in compiling PHP extensions. Next, you must understand the Zend API. Because Facebook's engineering team is small, each engineer must support more than 1 million of users. Some codes are not understandable to everyone in the team, which is unacceptable to Facebook.

12 3 Next page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.