You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Graalphp is an experimental just-in-time (JIT) compiler and runtime
for PHP 7.4+ hosted on GraalVM.
Abstract
PHP is a popular, weakly typed, general purpose programming
language. Originally designed for building dynamic web pages, the
language has since gained wide adoption in server-side web
development. In this work, we describe the design and
implementation of graalphp, an experimental compiler and
runtime for PHP hosted on Truffle and GraalVM. GraalVM is a virtual
machine that supports execution of multiple languages, which are
implemented as Abstract Syntax Tree (AST) interpreters based on
Truffle. GraalVM uses Graal as its JIT compiler to compile
frequently executed code fragments to machine code. We implement a
subset of the PHP language to run synthetic benchmarks by
The Computer Language Benchmarks Game. We compare peak
performance of our implementation against PHP 7 as well as
alternative implementations such as HHVM, JPHP and an early alpha
version of PHP 8. Experimental results indicate that our runtime
reaches competitive results with performance gains of up to 859%
compared to PHP 7. These preliminary results
suggest that a Truffle-hosted PHP implementation might be
significantly faster than existing language implementations.