Follow Us

Facebook releases open source PHP tool

HipHop for PHP aims to speed up complex websites

Technologists at Facebook on Tuesday are releasing a source code transformer intended to boost the performance of PHP.

In development for the past two years, the technology, called HipHop for PHP, has been used to reduce the CPU usage on Facebook web servers by an average of about 50 percent, said Haiping Zhao, senior server engineer at Facebook.

"The project has had a tremendous impact on Facebook. We feel the web at large can benefit from HipHop, so we are releasing it as open source this evening in hope that it brings a new focus toward scaling large, complex websites with PHP," Zhao said in a statement on the Facebook Developers page.

The technology is not complete and users need to be comfortable with HipHop before trying it out, said Zhao.

HipHop, he said, technically is not a compiler. It features a code transformer, a reimplementation of PHP's runtime system and a rewrite of some common PHP extensions to boost performance optimisations.

"HipHop programmatically transforms your PHP source code into highly optimised C++ and then uses g++ to compile it," Zhao said. "HipHop executes the source code in a semantically equivalent manner and sacrifices some rarely used features, such as eval(), in exchange for improved performance."

PHP, Zhao said, offers benefits in terms of programmer productivity, as do other scripting languages such as Perl, Python and Ruby. But scripting languages are known to be less efficient in terms of CPU and memory usage, he said.

"Because of this, it's been challenging to scale Facebook to over 400 billion PHP-based page views every month," Zhao said.

HipHop allows developers to keep the best aspects of PHP while taking advantage of performance of C++,  said Zhao.

"In total, we have written over 300,000 lines of code and more than 5,000 unit tests. All of this will be released this evening on GitHub under the open source PHP license," Zhao said.






Send to a friend

Email this article to a friend or colleague:

PLEASE NOTE: Your name is used only to let the recipient know who sent the story, and in case of transmission error. Both your name and the recipient's name and address will not be used for any other purpose.

Techworld White Papers

Business continuity and disaster recovery for SMBs

Business continuity (BC) and disaster recovery (DR) are major issues for all businesses, with...

Download Whitepaper

How to get your business ready for the 2012 Olympics

IT Manager: "I'm working on contingency plans to ensure that we can keep the business running...

Download Whitepaper

10 things you have to do today to protect your business in 2012

The next twelve months will be like a fair ground ride: rotation, uncertainty and mild...

Download Whitepaper

Data protection strategies in the age of the iPad

In today’s target-rich environment, CISOs must focus on defending the content of files and...

Download Whitepaper

Techworld UK - Technology - Business

Techworld Awards

Techworld Awards Winners 2011


Learn who the winners of this year's Techworld Awards are. Video footage coming soon...

Find out more
Techworld Mobile Site

Access Techworld's content on the move

Get the latest news, product reviews and downloads on your mobile device with Techworld's mobile site.

Find out more...

Site Map

* *