Optimize PHP 4
By Stephanos Gosling
PHP has matured into a powerful language that's easy to learn and is supported on many platforms. However, flexibility and ease of use come at a price: system performance. PHP, like all interpreted languages, must be converted to code native to the host system. In the compiled languages, the compiler does this once before deployment, of course, (a pain when incrementally upgrading a live project). Interpretation can impact performance considerably, especially on a smaller system or a heavily loaded one, because it takes time to perform. PHP is by no means slow, but it's still slower than code that's compiled beforehand and runs natively on a system (though Zend Technologies, employer of PHP inventors, developers, and administrators claim to have increased the PHP4 interpreter's speed 20 to 100 percent over PHP 3).
Zend Technologies totally rewrote the PHP 4 interpreter, called the Zend Engine, following a new set of design philosophies that affected many features including modularity and extensibility. As I mentioned before, these changes made the interpreter much faster when faced with complex scripts. The Zend Engine's modularity will also allow the Zend folks to introduce several products later this year that will further increase PHP's performance. One available now is the Zend Optimizer.
The Optimizer is a small library (around 120k, depending on your system) that integrates itself into the Zend Engine; and from there, the Optimizer works its magic. The Zend Engine has two components: the runtime compiler and the executor.