Benchmarks
Benchmarking process
All benchmarks are carried out on the same machine:
Dual-core Xeon CPU 3.00 GHz
2 Gb DDR 2 memory
Ubuntu 10.04 LTS
Apache 2.2.14
Zend Server CE 5.01 with PHP 5.3.2
There should be little or no access to the box during the testing process.
All tests are repeated 10-20 times to ensure accuracy.
Frameworks for comparism
Zend Framework 1.10.5 – probably the most commonly used PHP framework today.
Cake PHP 1.3.1 – another fairly popular framework.
Yii Framework – a framework claiming to be one of the fastest PHP MVC frameworks around.
I will be comparing these frameworks to LiteMVC in 2 separate configurations:
Standard – the framework loads a number of common modules, such as error handling and sessions.
Minimalist – the framework loads only the minimum required modules, such as request, dispatch, view.
Hello world test
The first test is simple and straight forward. Each framework must display a rendered page containing ‘Hello world!’ in the browser.
The blue bars represent a standard PHP configuration, the red bars are with Zend Optimizer+ enabled which caches PHP files as bytecode.

Cake was far far the slowest framework in the test, taking almost 90ms to render the page and over 60ms to render even with Optimizer+ enabled.
Closely behind Cake is Zend with almost 50ms (around 25ms with Optimizer+).
Yii is a bit of a dark horse, I’d never even heard of it before but found it via Google from various searches for fast MVC frameworks. It had a number of demos with the download so I used it’s own demo hello world application for the test. It was easily in second place for the standard PHP test, taking around 12ms, with Optimizer+ enabled this was reduced to a very impressive 3.4ms. From a quick look at the docs and code for Yii it does appear to have a few nasties, firstly configuration files are PHP arrays which are not always the easiest to maintain and secondly they have a slightly odd naming convention for the components of the framework.
LiteMVC did quite well in the test, taking just 7ms to render the page with the standard configuration and coming out the clear winner. With Optimizer+ enabled this was reduced to 4.2ms. Using the minimalist configuration file it just beat Yii by around 100 microseconds, however I feel this configuration is somewhat unrealistic as it is unlikely that almost no components of the framework will be used.
The results
| Standard PHP setup (No cache) | With opcode caching (Optimizer+) |
|---|---|
| 1st LiteMVC 0.1 alpha 2nd Yii Framework 1.1.2 3rd Zend Framework 1.10.5 4th CakePHP 1.3.1 |
1st Yii Framework 1.1.2 2nd LiteMVC 0.1 alpha 3rd Zend Framework 1.10.5 4th CakePHP 1.3.1 |