Close
  • Latest News
  • Artificial Intelligence
  • Video
  • Big Data and Analytics
  • Cloud
  • Networking
  • Cybersecurity
  • Applications
  • IT Management
  • Storage
  • Sponsored
  • Mobile
  • Small Business
  • Development
  • Database
  • Servers
  • Android
  • Apple
  • Innovation
  • Blogs
  • PC Hardware
  • Reviews
  • Search Engines
  • Virtualization
Read Down
Sign in
Close
Welcome!Log into your account
Forgot your password?
Read Down
Password recovery
Recover your password
Close
Search
Logo
Logo
  • Latest News
  • Artificial Intelligence
  • Video
  • Big Data and Analytics
  • Cloud
  • Networking
  • Cybersecurity
  • Applications
  • IT Management
  • Storage
  • Sponsored
  • Mobile
  • Small Business
  • Development
  • Database
  • Servers
  • Android
  • Apple
  • Innovation
  • Blogs
  • PC Hardware
  • Reviews
  • Search Engines
  • Virtualization
More
    Home Applications
    • Applications
    • Development
    • Servers

    Facebook Rocks the PHP World with HipHop

    Written by

    Darryl K. Taft
    Published February 2, 2010
    Share
    Facebook
    Twitter
    Linkedin

      eWEEK content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

      As predicted, Facebook has delivered a new PHP platform called HipHop for PHP that delivers much improved performance to the popular PHP scripting language that is known for its relative lack of performance.

      As Facebook uses PHP extensively for many of its systems, the social networking leader put a small team of engineers together to come up with a solution to the PHP performance issues, as well as scalability issues-because scalability of dynamic, or scripting, languages has been an area of concern for some of the huge social networking platform providers. Twitter has had a number of difficulties in scaling Ruby. And Facebook set out to whip PHP into a scalable, well-performing, well-behaved citizen of its IT environment.

      SD Times initially got wind of the PHP doings at Facebook.

      Haiping Zhao, the Facebook engineer that launched the project, said, “Scripting languages are known to be far less efficient when it comes to CPU and memory usage. Because of this, it’s been challenging to scale Facebook to over 400 billion PHP-based pages views every month.” Yet, PHP is so popular because of its simplicity, he said. It is “Simple to learn, simple to write, simple to read, and simple to debug,” he said. “We are able to get new engineers ramped up at Facebook a lot faster with PHP than with other languages, which allows us to innovate faster.”

      During the last two years the team toiled away in stealth mode, finally unleashing HipHop on Feb. 2. And despite the scale challenges, HipHop is showing a payoff. In a blog post about the new technology, Zhao wrote:

      ““Today I’m excited to share the project a small team of amazing people and I have been working on for the past two years: HipHop for PHP. 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. This 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. While HipHop has shown us incredible results, it’s certainly not complete and you should be comfortable with beta software before trying it out.”“

      Zhao added:

      ““HipHop for PHP isn’t technically a compiler itself. Rather it is a source code transformer. HipHop programmatically transforms your PHP source code into highly optimized C++ and then uses g++ to compile it. HipHop executes the source code in a semantically equivalent manner and sacrifices some rarely used features-such as eval()-in exchange for improved performance. HipHop includes a code transformer, a reimplementation of PHP’s runtime system, and a rewrite of many common PHP Extensions to take advantage of these performance optimizations.”“

      Scaling PHP

      In essence, Zhao and the team set out to scale PHP to the point that it suited Facebook’s unique needs. Describing those needs and the benefits of the HipHop solution, Zhao said:

      ““Scaling Facebook is particularly challenging because almost every page view is a logged-in user with a customized experience. When you view your home page we need to look up all of your friends, query their most relevant updates (from a custom service we’ve built called Multifeed), filter the results based on your privacy settings, then fill out the stories with comments, photos, likes, and all the rich data that people love about Facebook. All of this in just under a second. HipHop allows us to correct the logic that does the final page assembly in PHP and iterate it quickly while relying on custom back-end services in C++, Erlang, Java, or Python to service the News Feed, search, Chat, and other core parts of the site.”“

      Zhao explained that a key idea for what eventually became HipHop originated at a Facebook Hackathon a few years ago, at which he worked on code to transform PHP into C++.

      Zhao’s post spelled out more of the details of working on the HipHop project and building out the development team. He also said Facebook has developed a technology known as HPHPi, which is an experimental interpreter designed for development. “When using HPHPi you don’t need to compile your PHP source code before running it,” he said. “It’s helped us catch bugs in HipHop itself and provides engineers a way to use HipHop without changing how they write PHP.”

      In summary, Zhao said:

      ““Overall HipHop allows us to keep the best aspects of PHP while taking advantage of the performance benefits of C++. 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.”“

      He also said Facebook engineers will be talking up the HipHop technology at various open-source and developer conferences, such as FOSDEM (Free and Open Source Developers’ European Meeting) and OSCON (O’Reilly Open Source Convention), over the next few months.

      Darryl K. Taft
      Darryl K. Taft
      Darryl K. Taft covers the development tools and developer-related issues beat from his office in Baltimore. He has more than 10 years of experience in the business and is always looking for the next scoop. Taft is a member of the Association for Computing Machinery (ACM) and was named 'one of the most active middleware reporters in the world' by The Middleware Co. He also has his own card in the 'Who's Who in Enterprise Java' deck.

      Get the Free Newsletter!

      Subscribe to Daily Tech Insider for top news, trends & analysis

      Get the Free Newsletter!

      Subscribe to Daily Tech Insider for top news, trends & analysis

      MOST POPULAR ARTICLES

      Artificial Intelligence

      9 Best AI 3D Generators You Need...

      Sam Rinko - June 25, 2024 0
      AI 3D Generators are powerful tools for many different industries. Discover the best AI 3D Generators, and learn which is best for your specific use case.
      Read more
      Cloud

      RingCentral Expands Its Collaboration Platform

      Zeus Kerravala - November 22, 2023 0
      RingCentral adds AI-enabled contact center and hybrid event products to its suite of collaboration services.
      Read more
      Artificial Intelligence

      8 Best AI Data Analytics Software &...

      Aminu Abdullahi - January 18, 2024 0
      Learn the top AI data analytics software to use. Compare AI data analytics solutions & features to make the best choice for your business.
      Read more
      Latest News

      Zeus Kerravala on Networking: Multicloud, 5G, and...

      James Maguire - December 16, 2022 0
      I spoke with Zeus Kerravala, industry analyst at ZK Research, about the rapid changes in enterprise networking, as tech advances and digital transformation prompt...
      Read more
      Video

      Datadog President Amit Agarwal on Trends in...

      James Maguire - November 11, 2022 0
      I spoke with Amit Agarwal, President of Datadog, about infrastructure observability, from current trends to key challenges to the future of this rapidly growing...
      Read more
      Logo

      eWeek has the latest technology news and analysis, buying guides, and product reviews for IT professionals and technology buyers. The site’s focus is on innovative solutions and covering in-depth technical content. eWeek stays on the cutting edge of technology news and IT trends through interviews and expert analysis. Gain insight from top innovators and thought leaders in the fields of IT, business, enterprise software, startups, and more.

      Facebook
      Linkedin
      RSS
      Twitter
      Youtube

      Advertisers

      Advertise with TechnologyAdvice on eWeek and our other IT-focused platforms.

      Advertise with Us

      Menu

      • About eWeek
      • Subscribe to our Newsletter
      • Latest News

      Our Brands

      • Privacy Policy
      • Terms
      • About
      • Contact
      • Advertise
      • Sitemap
      • California – Do Not Sell My Information

      Property of TechnologyAdvice.
      © 2024 TechnologyAdvice. All Rights Reserved

      Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.

      ×