Please use this identifier to cite or link to this item:
Main Title: Static optimization in PHP 7
Author(s): Popov, Nikita
Cosenza, Biagio
Juurlink, Ben
Stogov, Dmitry
Type: Conference Object
Language Code: en
Abstract: PHP 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 web applications such as WordPress, Wikipedia, and Facebook. PHP's highly dynamic nature, while providing useful language features, also makes it hard to optimize statically. This paper reports on the implementation of purely static bytecode optimizations for PHP 7, the last major version of PHP. We discuss the challenge of integrating classical compiler optimizations, which have been developed in the context of statically-typed languages, into a programming language that is dynamically and weakly typed, and supports a plethora of dynamic language features. Based on a careful analysis of language semantics, we adapt static single assignment (SSA) form for use in PHP. Combined with type inference, this allows type-based specialization of instructions, as well as the application of various classical SSA-enabled compiler optimizations such as constant propagation or dead code elimination. We evaluate the impact of the proposed static optimizations on a wide collection of programs, including micro-benchmarks, libraries and web frameworks. Despite the dynamic nature of PHP, our approach achieves an average speedup of 50% on micro-benchmarks, 13% on computationally intensive libraries, as well as 1.1% (MediaWiki) and 3.5% (WordPress) on web applications.
Issue Date: 2017
Date Available: 7-Jun-2018
DDC Class: 004 Datenverarbeitung; Informatik
Subject(s): PHP
static optimization
SSA form
Proceedings Title: Proceedings of the 26th International Conference on Compiler Construction - CC 2017
Publisher: Association for Computing Machinery (ACM)
Publisher Place: New York, NY, USA
Publisher DOI: 10.1145/3033019.3033026
Page Start: 65
Page End: 75
ISBN: 978-1-4503-5233-8
Appears in Collections:FG Architektur eingebetteter Systeme » Publications

Files in This Item:
File Description SizeFormat 
popov_etal_2017.pdf1.06 MBAdobe PDFThumbnail

Items in DepositOnce are protected by copyright, with all rights reserved, unless otherwise indicated.