The Test
We have each programmer picked a popular PHP framework, and the task is to setup the framework and create MVC for the benchmark, which involves,- 1000 database insertion
- 1000 database update
- query 1000 records (all fields), and display in a list
- each record size is about 2kb
- Pentium 4, 4.3GHz
- 2GB RAM
- Windows XP, SP3
- XAMPP 1.7.0 (patched to work with PDO)
- APC enabled (Zend Optimizer disabled)
- All programs turned off, including Anti-Virus and Firewall
The Result
Framework | Database Engine | Avg. Response Time | Avg. Memory Usage |
---|---|---|---|
Pure PHP | mysqli | 5.28s
|
0.14MB
|
oModel* | adodb mysql | 7.13s
|
6.88MB
|
Yii Framework (yiilite) |
pdo_mysql | 7.41s
|
8.38MB
|
Yii Framework | pdo_mysql | 7.7s
|
9.44MB
|
Kohana | mysqli | 7.68s
|
11.22MB#
|
Zend Framework | pdo_mysql | 8.37s
|
7.99MB
|
Zend Framework | mysqli | 11.28s
|
7.88MB
|
Akelos | mysqli | 12.98s
|
10.93MB
|
# With <benchmark> parameter turned off in the database config file, it only uses 1.5MB memory, and takes about 7.8s. Thanks Jeremy Bush for the advice. (updated 24/07/2009)
The Verdicts
Framework | Pro. | Con. |
---|---|---|
oModel | Fastest framework, light file structure, highly flexible, real short learning curve | Not as comprehensive, not well documented, no community support, need high skill set to work on for large-scale project |
Yii Framework | Fast, comprehensive, simple and secure file structure, strictly php5 OO, well documented, code generation | Farely new, still building community awareness |
Kohana | Flexibility, Easy start | Big memory footprint, DB feature incomplete |
Zend Framework | Great library set, flexible, best community support | Long learning curve, code generation problem* |
Akelos | Great RoR port, database migration | Slow, php4 |