Facebook tool aims to speed up PHP
InfoWorld - 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%, said Haiping Zhao, senior server engineer at Facebook.
[ InfoWorld reported on PHP 6 highlights, including internationalization, that were detailed at a technical conference late last year. ]
"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 Web sites 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 optimizations.
"HipHop programmatically transforms your PHP source code into highly optimized 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.
This story, "Facebook looks to speed up PHP," was originally published at InfoWorld.com. Follow the latest developments in software development at InfoWorld.com.
Read more about developer world in InfoWorld's Developer World Channel.



- Excel 2010 Cheat Sheet
- Register for this Computerworld Insider Cheat Sheet and gain access to hundreds of premium content articles, guides, product reviews and more.
- The Keys to Distributed & Agile Application Development
- How leading firms are winning with strategies for efficient application development, without relying on co-location.
- Overcome Top 7 Admin Challenges of Active Directory
- As Active Directory's role in the enterprise has drastically increased, so has the need to secure the data. Gain insight on creating repeatable,...
- Insiders Can Ruin Your Company. Take Action.
- Did you know that 80 percent of threats to an organization come from the inside? The threat from insiders is often overlooked in...
- Top Solutions and Tools to Prevent Devastating Malware
- Custom malware frequently goes undetected. According to Forrester Research, the best way to reduce risk of breach is to deploy file integrity monitoring...
- Streamline Compliance and Increase ROI
- Streamline, simplify, and automate compliance related activities; especially those that impact multiple business units. This white paper from NetIQ, outlines solutions that will... All App Development White Papers
- Reduced TCO for Communications Applications with New Oracle SPARC Servers
- In this webcast learn how Oracle's new SPARC T4 servers and SPARC Supercluster deliver the security, performance, and scalability required for 4G network...
- Optimizing Networks for the Cloud
- Join guest speaker, Rohit Mehra, IDC Director of Enterprise Communications Infrastructure, to explore current trends, discuss best practices for optimizing Data Center and...
- Apps QuickStart Series Part 2: Designing and Deploying SQL Server on VMware vSphere
- Download this webcast to learn about the design considerations for virtualizing SQL workloads, performance and scalability information and high-availability options, as well as...
- Apps QuickStart Series Part 1: Designing and Deploying Exchange 2010 on VMware vSphere
- Download this webcast to learn the virtual hardware design considerations for Exchange 2010, deployment using the building block approach, options for high-availability and...
- Customer Spotlight: How IPC The Hospitalist Company Implemented Oracle on VMware
- Have you been looking to hear about customer's experiences with the new VMware vCenter Site Recovery Manager product? View this webcast to learn... All App Development Webcasts