Faster PHP on Resin/JVM

The Server Side reports Caucho adds PHP support to Resin to allow it to run up to 6 times faster. It is done by compiling PHP into Java bytecode so that it can be executed in highly optimised Java virtual machines.

From this comment, Quercus (the PHP module for Resin application server) actually implemented most of the PHP API's (which is massive) to provide compatibility, and even their own Mantis bug tracker, an open source PHP app, is now running on their Java platform.


I guess it would be more of a threat to other PHP accelerators like PHPA and Zend. PHP's poor performance is obvious in large applications -- every script is parsed and compiled everytime it is executed, and many of those accelerators provide nothing but bytecode cache to save on the parsing and compilation time. Now there's another platform that does on-demand compilation.

However, I guess it is more than just caching the bytecode. What makes PHP on Java fast is actually the VM itself. We cannot deny that JVM is probably one of the fastest and most well-optimised VM out there, and JVM bytecodes are usually dynamically compiled into native code in JIT. The same can be said about the .NET's CLR -- a well optimised VM can sometimes run close to native code speed.

Therefore sometimes I wonder whether it is a better idea to compile your language as bytecode to run on a well-optimised VM, than spend time coding the actual virtual machine to run your intepreted scripting language. As a Python programmer (not yet a hyper-enthusiasts), I am interested in projects like PyPy, Jython and IronPython that might eventually and constantly out-perform CPython.