I understand now or at least a little bit more why JIT compilation wouldn’t be useful.
Most pages will take less than a second to execute. Caching, where possible, will also be used to further decrease the time. Opcode Caches can also be used to keep PHP from compiling the page with each request further decreasing the time it takes. Taken all together most professional web sites wouldn’t benefit from JIT compilation. Given the delay from converting to machine code, it might actually take longer on the first run.
Would it be quicker to write a C extension for PHP than building a JIT compiler for the Zend Engine? Yes. In the discussion with Frameworks, the solution is to write the slow PHP code in C and write a function to be called in PHP, if available. My argument has always been that I shouldn’t have to. If it is just as fast using JIT compilation than I shouldn’t have to touch C code unless I’m binding some library in C or C++ to be used in PHP.
Yeah, 2x time decrease (Roadsend compiler statistics) doesn’t sound like much, but I would like to run algorithms that normally take 15 to 30 seconds in half the time. That to me is a huge deal. Now, these algorithms won’t run in front end pages, of course, but I would like to maintain the code in PHP. The possibility of the algorithm being poor is there, and so is that it would be better writing the code in C/C++.
Well, what I’m trying to get at, is that with edge cases JIT compilation would make a lot of sense. For those with normal pages, then I concede that you are correct.
Possibly Related Posts:
- What is the Obituary Story
- Hashing Out Obituary Book Details
- English IV: Untitled Satire
- Userland Multitasking: Introduction
- PHP Opcode Series