The HipHop compiler for PHP
Authors:
Open Access
- 19 October 2012
- journal article
- conference paper
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 47 (10) , 575-586
Abstract
Scripting languages are widely used to quickly accomplish a variety of tasks because of the high productivity they enable. Among other reasons, this increased productivity results from a combination of extensive libraries, fast development cycle, dynamic typing, and polymorphism. The dynamic features of scripting languages are traditionally associated with interpreters, which is the approach used to implement most scripting languages. Although easy to implement, interpreters are generally slow, which makes scripting languages prohibitive for implementing large, CPU-intensive applications. This efficiency problem is particularly important for PHP given that it is the most commonly used language for server-side web development. This paper presents the design, implementation, and an evaluation of the HipHop compiler for PHP. HipHop goes against the standard practice and implements a very dynamic language through static compilation. After describing the most challenging PHP features to support through static compilation, this paper presents HipHop's design and techniques that support almost all PHP features. We then present a thorough evaluation of HipHop running both standard benchmarks and the Facebook web site. Overall, our experiments demonstrate that HipHop is about 5.5x faster than standard, interpreted PHP engines. As a result, HipHop has reduced the number of servers needed to run Facebook and other web sites by a factor between 4 and 6, thus drastically cutting operating costs.Keywords
This publication has 9 references indexed in Scilit:
- HappyJIT2011
- Dynamic interpretation for dynamic scripting languages2010
- Evaluation of a just-in-time compiler retrofitted for PHP2010
- Trace-based just-in-time type specialization for dynamic languages2009
- A practical solution for scripting language compilers2009
- PyPy's approach to virtual machine construction2006
- TraitsACM Transactions on Programming Languages and Systems, 2006
- Scripting: higher level programming for the 21st CenturyComputer, 1998
- Principal type-schemes for functional programs1982