Abstract
Current websites are a combination of server-generated dynamic content with client-side interactive programs. Dynamically - typed languages have gained a lot of ground in both of these domains. The growth of Web 2.0 has introduced a myriad of websites which contain personalized content, which is specific to the user. PHP or Python programs generate the actual HTML page after querying a database and processing the results, which are then presented by the browser. It is becoming more and more vital to accelerate the execution of these programs, as this is a significant part of the total time needed to present the page to the user.
This paper presents a novel interpreter for the PHP language written in RPython, which the PyPy translator then translates into C. The translator integrates into the interpreter a tracing just-in-time compiler which optimizes the hottest loops in the interpreted programs. We also describe a data model that supports all the data types in the PHP language, such as references and iterators. We evaluate the performance of this interpreter, showing that speedups up to a factor of 8 are observed using this approach.
- The Alternative PHP Cache. http://pecl.php.net/package/APC.Google Scholar
- cfront. http://www.softwarepreservation.org/projects/c_plus_plus/cfront.Google Scholar
- HipHop for PHP. https://github.com/facebook/hiphop-php.Google Scholar
- The PHP Benchmark. http://www.phpbench.com/.Google Scholar
- PyPy official documentation, http://codespeak.net/pypy/dist/pypy/doc.Google Scholar
- PyPy language front ends, http://codespeak.net/svn/pypy/lang/.Google Scholar
- Roadsend PHP. http://www.roadsend.com/home/index.php.Google Scholar
- The Computer Language Benchmarks Game. http://shootout.alioth.debian.org/.Google Scholar
- Unladen Swallow. http://code.google.com/p/unladen-swallow/.Google Scholar
- The Zend PHP engine. http://www.zend.com/en/community/php/.Google Scholar
- O. Agesen. The cartesian product algorithm: Simple and precise type inference of parametric polymorphism. In Proceedings of the 1995 European Conference on Object-Oriented Programming, ECOOP '95, pages 2--26, London, UK, UK, 1995. Springer-Verlag. ISBN 3-540-60160-0. Google Scholar
Digital Library
- D. Ancona, M. Ancona, A. Cuni, and N. D. Matsakis. RPython: a step towards reconciling dynamically and statically typed OO languages. In Proceedings of the 2007 Dynamic Languages Symposium, DLS '07, pages 53--64, New York, NY, USA, 2007. ACM. ISBN 978-1-59593-868-8. Google Scholar
Digital Library
- V. Bala, E. Duesterwald, and S. Banerjia. Dynamo: a transparent dynamic optimization system. In Proceedings of the 2000 Conference on Programming Language Design and Implementation, PLDI '00, pages 1--12, New York, NY, USA, 2000. ACM. ISBN 1-58113-199-2. Google Scholar
Digital Library
- P. Biggar, E. de Vries, and D. Gregg. A practical solution for scripting language compilers. In Proceedings of the 2009 Symposium on Applied Computing, SAC '09, pages 1916--1923, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-166-8. Google Scholar
Digital Library
- C. F. Bolz, A. Cuni, M. Fijalkowski, and A. Rigo. Tracing the meta-level: PyPy's tracing JIT compiler. In Proceedings of the 2009 Workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems, ICOOOLPS '09, pages 18--25, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-541-3. Google Scholar
Digital Library
- C. F. Bolz, M. Leuschel, and D. Schneider. Towards a jitting VM for Prolog execution. In Proceedings of the 2010 International Symposium on Principles and Practice of Declarative Programming, PPDP '10, pages 99--108, New York, NY, USA, 2010. ACM. ISBN 978-1-4503-0132-9. Google Scholar
Digital Library
- M. Chang, E. Smith, R. Reitmaier, M. Bebenita, A. Gal, C. Wimmer, B. Eich, and M. Franz. Tracing for web 3.0: trace compilation for the next generation web applications. In Proceedings of the 2009 International Conference on Virtual Execution Environments, VEE '09, pages 71--80, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-375-4. Google Scholar
Digital Library
- A. Gal and M. Franz. Incremental dynamic code generation with trace trees. Technical Report ICS-TR-06-16, University of California, Irvine, 2006.Google Scholar
- A. Gal, C. W. Probst, and M. Franz. HotpathVM: an effective JIT compiler for resource-constrained devices. In Proceedings of the 2006 International Conference on Virtual Execution Environments, VEE '06, pages 144--153, New York, NY, USA, 2006. ACM. ISBN 1-59593-332-8. Google Scholar
Digital Library
- A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. W. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based just-in-time type specialization for dynamic languages. In Proceedings of the 2009 Conference on Programming Language Design and Implementation, PLDI '09, pages 465--478, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-392-1. Google Scholar
Digital Library
- R. Ierusalimschy, L. H. D. Figueiredo, and W. Celes. The Implementation of Lua 5.0. Journal of Universal Computer Science, 11: 2005.Google Scholar
- C. Lattner and V. Adve. LLVM: A compilation framework for lifelong program analysis & transformation. Proceedings of the 2004 International Symposium on Code Generation and Optimization, 0: 75, 2004. Google Scholar
Digital Library
- N. Lopes. Building a JIT compiler for PHP in 2 days, 2008.Google Scholar
- D. Rethans. The Vulcan Logic Dumper. http://derickrethans.nl/projects.html.Google Scholar
- A. Rigo. Representation-based just-in-time specialization and the psyco prototype for Python. In Proceedings of the 2004 Symposium on Partial Evaluation and Semantics-based Program Manipulation, PEPM '04, pages 15--26, New York, NY, USA, 2004. ACM. ISBN 1-58113-835-0. Google Scholar
Digital Library
- M. Serrano and P. Weis. Bigloo: A portable and optimizing compiler for strict functional languages. In Proceedings of the 1995 International Symposium on Static Analysis, SAS '95, pages 366--381, London, UK, 1995. Springer-Verlag. ISBN 3-540-60360-3. Google Scholar
Digital Library
- Y. Shi, K. Casey, M. A. Ertl, and D. Gregg. Virtual machine showdown: Stack versus registers. ACM Transactions on Architecture and Code Optimization, 4: 2:1--2:36, January 2008. ISSN 1544-3566. Google Scholar
Digital Library
- M. Tatsubori, A. Tozawa, T. Suzumura, S. Trent, and T. Onodera. Evaluation of a just-in-time compiler retrofitted for PHP. In Proceedings of the 2010 International Conference on Virtual Execution Environments, VEE '10, pages 121--132, New York, NY, USA, 2010. ACM. ISBN 978-1-60558-910-7. Google Scholar
Digital Library
- A. Yermolovich, C. Wimmer, and M. Franz. Optimization of dynamic languages using hierarchical layering of virtual machines. In Proceedings of the 2009 Symposium on Dynamic languages, DLS '09, pages 79--88, New York, NY, USA, 2009. ACM. ISBN 978-1-60558-769-1. Google Scholar
Digital Library
- M. Zaleski, A. D. Brown, and K. Stoodley. YETI: a gradually extensible trace interpreter. In Proceedings of the 2007 International Conference on Virtual Execution Environments, VEE '07, pages 83--93, New York, NY, USA, 2007. ACM. ISBN 978-1-59593-630-1. Google Scholar
Digital Library
Index Terms
HappyJIT: a tracing JIT compiler for PHP
Recommendations
HappyJIT: a tracing JIT compiler for PHP
DLS '11: Proceedings of the 7th symposium on Dynamic languagesCurrent websites are a combination of server-generated dynamic content with client-side interactive programs. Dynamically - typed languages have gained a lot of ground in both of these domains. The growth of Web 2.0 has introduced a myriad of websites ...
Amalgamating different JIT compilations in a meta-tracing JIT compiler framework
DLS 2020: Proceedings of the 16th ACM SIGPLAN International Symposium on Dynamic LanguagesMost virtual machines employ just-in-time (JIT) compilers to achieve high-performance. Trace-based compilation and method-based compilation are two major compilation strategies in JIT compilers. In general, the former excels in compiling programs with ...
Tracing for web 3.0: trace compilation for the next generation web applications
VEE '09: Proceedings of the 2009 ACM SIGPLAN/SIGOPS international conference on Virtual execution environmentsToday's web applications are pushing the limits of modern web browsers. The emergence of the browser as the platform of choice for rich client-side applications has shifted the use of in-browser JavaScript from small scripting programs to large ...







Comments