A simple performance comparison of 6 PHP MVC style frameworks using PHP 7.1.
- Test Kit: php-framework-benchmark
- Test Server: Digital Ocean Ubuntu 16.04.1 x64 2gb / 2CPU droplet.
- Test Software: PHP 7.1.0, Apache 2.4.18
I used a minimal installation of PHP and Apache with no additional configurations or sever settings changed.
Overview
The benchmark tool kit executes a simple “hello world”, it does this with the frameworks minimal settings, no database, no debugging and if possible, no template engine.
Read more about the testing on the benchmark tool kits page.
Results
Out of the 6 frameworks tested Codeigniter 3 produced the most requests per second and the least memory usage. Zend Framework 2.5 produced the least requests per second and Laravel 5.3 produced the most memory usage.
No framework: 7,094 requests per second, .34M memory.
Codeigniter 3: 2,245 requests per second, .38M memory.
Lumen 5.3: 1,543 requests per second, .63M memory.
Fuel 1.8: 1,033 requests per second, .60M memory.
Symfony 3.0: 551 requests per second, 1.52M memory.
Laravel 5.3: 331 requests per second, 1.53M memory
Zend 2.5: 291 requests per second, 1.34M memory
Compared to PHP 7.0 we see close to 2,000 more requests per second with no framework along with a considerable increase for Codeigniter 3.
Requests Per Second
Codeigiter produces the most requests per seconds. Lumen and Fuel perform decently well but the rest of the frameworks produced very low results.
Memory
Codeigniter consumes the least amount of memory. Lumen and Fuel come in under 1M but Laravel, Symfony and Zend consume more then double the memory of the other frameworks.
Execution Time
Laravel and Zend take the longest time to execute with Symfony close behind. Fuel and Lumen are the fastest and Codeigniter has fallen to 3rd place.
Included Files
Codeigniter, Lumen and Fuel remain the top 3 frameworks that include the least files. Symfony is loading less files while Laravel has appeared to doubled the amount of included files.
PHP 7.0 Comparison
We see most frameworks have improved requests per second. Laravel has moved up one spot and all frameworks serve more requests then before.
Almost all the frameworks utilize less memory. In the case of Laravel and Symfony we see memory usage now under 2M.