Faster PHP Through Java
On Apache, PHP performance is limited because each request gets its own process, with little communication between processes, and little caching of frequently used data. In addition, each process must typically connect and authenticate with the database, which can affect performance.
Benchmark tests show that Quercus, Caucho's Java implementation of PHP, performs faster than PHP on Apache. Quercus is a Java servlet that runs in Resin or any other Java application server. Using just-in-time compilation, it converts PHP code into optimized Java code, which is then compiled into bytecodes. Instead of isolated processes, Quercus uses threads from the application server's global thread pool, enabling it to do more caching of data across requests. It also reduces overhead by using the Java application server's database connection pool. Quercus can also take advantage of proxy caching, such as the proxy cache built into the Resin application server.
In all eighteen of the standard PHP benchmark tests available at php.net, Quercus outperformed PHP, completing the entire series in 0.891 seconds as compared to 7.981 seconds for PHP. Additional testing shows that Quercus improves the performance of popular applications such as Drupal, phpBB, and most dramatically, Wordpress, which ran twice as fast with Quercus. It also runs 20-40 times faster than the PHP/Java Bridge.
Using Quercus, you can develop hybrid PHP-Java applications, with the benefits of PHP for front-end site development and the enterprise features of Java, such as transactions, clustering, distributed sessions, and distributed caching.