Nuno Lopes, on his way from Portugal to Apple HQ via Oregon, stopped in at Oracle HQ to have a chat and give a sneak preview of a talk he's presenting at http://llvm.org/devmtg/ tomorrow:
The Zend Engine (the PHP VM) interprets bytecode directly without performing any optimization. The phpllvm project provides a JIT compiler for the Zend Engine that is able to compile PHP/Zend bytecode to LLVM IR and then into optimized machine code, which can then be executed by the Zend engine. I'll describe how the JIT compiler hooks in the Zend engine and how the whole process works. I'll also describe possible future work, including a PHP compiler, PHP-specific optimizations, type-inference, etc.
Initially part of a Google Summer of Code project supervised by Nuno, he himself is now working on it. If his Masters thesis doesn't get in the way, we might see some very interesting uses of the work.
Nuno knows his stuff in this area. Next year I really would like to see him talking on this current project or general PHP optimization at a PHP conference.
Comments (2)
This sounds very interesting. How does this compare to things like APC? Is it a similar concept, or completely different?
Posted by Ivo | July 31, 2008 11:47 PM
Posted on July 31, 2008 23:47
APC's opcode cache is primed from the compile stage. Nuno's project works by replacing the later Zend execute code. Storing the optimized output in APC is a big project yet to be looked at.
Posted by Chris Jones | August 1, 2008 8:19 AM
Posted on August 1, 2008 08:19