Tag Archives: compiler

Facebook HipHop Compiler for PHP: What Is It For You?

I attended a great seminar at Stanford by Haiping Zhao on the open source compiler which converts PHP code to C++ yesterday. Haiping is the tech lead for the open source HipHop project at Facebook.

As many have known, Facebook is a PHP shop with all the front end dynamic pages written in PHP. The upside of using PHP is that it’s very easy to read, write and debug, plus platform independent. The downside is that it’s really slow, probably one of the slowest scripting languages.

Why PHP is slow?

Haiping summarized three reasons, which he thinks are common contributors for slowness of scripting languages in general:

  1. Byte-code interpreter.
  2. Dynamic symbol lookups, including functions, variables, constants, class methods, properties, etc.
  3. Weakly typing. The zval has to evaluate the data type of any variable before any operation. Plus, the PHP array is too generic because it can represent any collection. 

Why Should Facebook Care?

When Haiping joined Facebook, new servers cannot catch up the new users. The server farms became so big that any percentage saving could save the company millions of dollars. Like all the big web companies, Facebook does not disclose the number of servers they have. The size of the datacenter is guarded as a secret. One of the professors did an estimate in his questions anyway: 15,000 to 30,000 servers.

Posted in Software Development | Also tagged , , | 2 Responses

    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__ doublecloud.org.

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.