skip to main content
10.1145/1735997.1736015acmconferencesArticle/Chapter ViewAbstractPublication PagesveeConference Proceedingsconference-collections
research-article

Evaluation of a just-in-time compiler retrofitted for PHP

Published:17 March 2010Publication History

ABSTRACT

Programmers who develop Web applications often use dynamic scripting languages such as Perl, PHP, Python, and Ruby. For general purpose scripting language usage, interpreter-based implementations are efficient and popular but the server-side usage for Web application development implies an opportunity to significantly enhance Web server throughput. This paper summarizes a study of the optimization of PHP script processing. We developed a PHP processor, P9, by adapting an existing production-quality just-in-time (JIT) compiler for a Java virtual machine, for which optimization technologies have been well-established, especially for server-side application. This paper describes and contrasts microbenchmarks and SPECweb2005 benchmark results for a well-tuned configuration of a traditional PHP interpreter and our JIT compiler-based implementation, P9. Experimental results with the microbenchmarks show 2.5-9.5x advantage with P9, and the SPECweb2005 measurements show about 20-30% improvements. These results show that the acceleration of dynamic scripting language processing does matter in a realistic Web application server environment. CPU usage profiling shows our simple JIT compiler introduction reduces the PHP core runtime overhead from 45% to 13% for a SPECweb2005 scenario, implying that further improvements of dynamic compilers would provide little additional return unless other major overheads such as heavy memory copy between the language runtime and Web server frontend are reduced.

References

  1. D. Ancona, M. Ancona, A. Cuni, and N. D. Matsakis. RPython: a step towards reconciling dynamically and statically typed oo languages. In DLS '07: Proceedings of the 2007 Symposium on Dynamic Languages, pages 53--64, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J. Benda, T. Matousek, and L. Prosek. Phalanger: Compiling and running PHP applications on the Microsoft .NET platform. In Proceedings of .NET Technologies 2006, the 4th International Conference on .NET Technolgoies, Plzen, Czech Republic, May 29 -- June 1, 2006, pages 11--20, 2006.Google ScholarGoogle Scholar
  3. R. Cartwright and M. Fagan. Soft typing. In Proceedings of the SIGPLAN '91 Conference on Programming Language Design and Implementation, pages 278--292, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. E. Cecchet, A. Chanda, S. Elnikety, J. Marguerite, andW. Zwaenepoel. Performance comparison of middleware architectures for generating dynamic web content. In Proceedings of Middleware 2003, ACM/IFIP/USENIX International Middleware Conference, Rio de Janeiro, Brazil, June 16--20, 2003, volume 2672 of Lecture Notes in Computer Science, pages 242--261. Springer, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. C. D. Chambers. The design and implementation of the self compiler, an optimizing compiler for object-oriented programming languages. PhD thesis, Stanford University, Stanford, CA, USA, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J.-D. Choi, M. Gupta, M. J. Serrano, V. C. Sreedhar, and S. P. Midkiff. Escape analysis for Java. In Proceedings of OOPSLA'99, Proceedings of the 1999 ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, number 10 in SIGPLAN Notices vol.34, pages 1--19, Denver, Colorado, USA, November 1999. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. K.-F. Faxén. Representation analysis for coercion placement. In Static Analysis, 9th International Symposium, SAS 2002, Madrid, Spain, September 17--20, 2002, Proceedings, volume 2477 of Lecture Notes in Computer Science, pages 278--293. Springer, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. Gal, C. W. Probst, and M. Franz. Hotpathvm: an effective jit compiler for resource-constrained devices. In VEE '06: Proceedings of the 2nd international conference on Virtual execution environments, pages 144--153, New York, NY, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. N. Grcevski, A. Kielstra, K. Stoodley, M. G. Stoodley, and V. Sundaresan. Java just-in-time compiler and virtual machine improvements for server and middleware applications. In Proceedings of the 3rd Virtual Machine Research and Technology Symposium, May 6--7, 2004, San Jose, CA, USA, pages 151--162. USENIX, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. F. Henglein. Global tagging optimization by type inference. In Proc. 1992 ACM Conf. on LISP and Functional Programming (LFP), San Francisco, California, pages 205--215. ACM Press, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. U. Hölzle, C. Chambers, and D. Ungar. Optimizing dynamically-typed object-oriented languages with polymorphic inline caches. In ECOOP '91: Proceedings of the European Conference on Object-Oriented Programming, pages 21--38, London, UK, 1991. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Hugunin. Python and Java -- the best of both worlds. In Proceedings of the 6th International Python Conference, October 14--17, 1997, pages 31--38, 1997.Google ScholarGoogle Scholar
  13. X. Leroy. Unboxed objects and polymorphic typing. In Conference Record of the Nineteenth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 177--188, Albequerque, New Mexico, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Y. Minamide and J. Garrigue. On the runtime complexity of typedirected unboxing. In ICFP '98: Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming, pages 1--12, New York, NY, USA, 1998. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Y. G. Park and B. Goldberg. Escape analysis on lists. In PLDI '92: Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation, pages 116--127, New York, NY, USA, 1992. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. U. V. Ramana. Some experiments with the performance of lamp architecture. In Proceedings of CIT 2005, Fifth International Conference on Computer and Information Technology, 21--23 September 2005, Shanghai, China, pages 916--921. IEEE Computer Society, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. A. Rigo. Representation-based just-in-time specialization and the psyco prototype for python. In Proceedings of PEPM 2004, the 2004 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-based Program Manipulation, 2004, Verona, Italy, August 24--25, 2004, pages 15--26. ACM, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Rigo and S. Pedroni. PyPy's approach to virtual machine construction. In OOPSLA '06: Companion to the 21st ACM SIGPLAN conference on Object-Oriented Programming Systems, Languages, and Applications, pages 944--953, New York, NY, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Standard Performance Evaluation Corporation. SPECWeb2005, 2005. http://www.spec.org/web2005/.Google ScholarGoogle Scholar
  20. L. Stepanian, A. D. Brown, A. Kielstra, G. Koblents, and K. Stoodley. Inlining Java native calls at runtime. In VEE '05: Proceedings of the 1st ACM/USENIX International Conference on Virtual Execution Environments, pages 121--131, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. T. Suzumura, M. Tatsubori, S. Trent, A. Tozawa, and T. Onodera. Highly scalable web applications with zero-copy data transfer. In Proceedings of the 18th International Conference on World Wide Web, WWW 2009, Madrid, Spain, April 20--24, 2009, pages 921--930, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. L. Titchkosky, M. F. Arlitt, and C. L.Williamson. A performance comparison of dynamic web technologies. SIGMETRICS Performance Evaluation Review, 31(3):2--11, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. A. Tozawa, M. Tatsubori, T. Onodera, and Y. Minamide. Copy-onwrite in the PHP language. In Proceedings of POPL 2009, the 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Savannah, Georgia, USA, January 21--23, 2009, pages 200--212. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. S. Trent, M. Tatsubori, T. Suzumura, A. Tozawa, and T. Onodera. Performance comparison of PHP and JSP as server-side scripting languages. In Proceedings of Middleware 2008, ACM/IFIP/USENIX 9th International Middleware Conference, Leuven, Belgium, December 1-5, 2008, pages 164--182. Springer, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. S. R. Warner and J. S. Worley. SPECweb2005 in the real world: Using IIS and PHP. In Proceedings of 2008 SPEC Benchmark Workshop, Millbrae, CA, USA, January 27, 2008. Standard Performance Evaluation Corporation (SPEC), 2008.Google ScholarGoogle Scholar

Index Terms

  1. Evaluation of a just-in-time compiler retrofitted for PHP

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      VEE '10: Proceedings of the 6th ACM SIGPLAN/SIGOPS international conference on Virtual execution environments
      March 2010
      176 pages
      ISBN:9781605589107
      DOI:10.1145/1735997
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 45, Issue 7
        VEE '10
        July 2010
        161 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1837854
        Issue’s Table of Contents

      Copyright © 2010 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 17 March 2010

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate80of235submissions,34%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!