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.
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Standard Performance Evaluation Corporation. SPECWeb2005, 2005. http://www.spec.org/web2005/.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Index Terms
Evaluation of a just-in-time compiler retrofitted for PHP
Recommendations
HHVM JIT: a profile-guided, region-based compiler for PHP and Hack
PLDI 2018: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and ImplementationDynamic languages such as PHP, JavaScript, Python, and Ruby have been gaining popularity over the last two decades. A very popular domain for these languages is web development, including server-side development of large-scale websites. As a result, ...
Static optimization in PHP 7
CC 2017: Proceedings of the 26th International Conference on Compiler ConstructionPHP is a dynamically typed programming language commonly used for the server-side implementation of web applications. Approachability and ease of deployment have made PHP one of the most widely used scripting languages for the web, powering important ...
The HipHop compiler for PHP
OOPSLA '12: Proceedings of the ACM international conference on Object oriented programming systems languages and applicationsScripting 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, ...







Comments