Some time ago I started writing another one Benchmark of php frameworks.
In my opinion minimal functional can't show real behavior of the framework. I have decided to test php frameworks by middle complexity application. This app will be represented as "blogs platform". It consist of data about authors, theirs posts by categories and types. Such app can be realized in any framework "from a box".
Pages for testing:
- /authors - lists of authors with posts counts.
- /posts - all posts with information about types, authors and categories.
- /categories - list of categories with counts of posts in every one.
- /index - simple "hello world" for comparison.
Quantity of notes about 1000. Authors and categories - 50-100pc.
It must be quite simple app, but at the same time (imho) it is capable to show dependencies between operations with data and page generation time and consumable memory
Will page generation time be equal or comparable? What surprises can we get? I am sure, throughput will be stuck in mysql bottleneck???. But the tendency will be obvious.
I have written test application for Laravel 5.4 and phalcon 3.2
Test results:
- https://steemit.com/programming/@semasping/benchmarking-php-frameworks-part-3-phalcon
- https://steemit.com/programming/@semasping/benchmark-php-frameworks-part-5-laravel
This results were obtained on the server with the following parameters:
Centos 7.2 + vestacp + apache2.4 + php 7.0.20 + mariadb 5.5.52
2 X86 64bit Cores 2GB memory (https://www.scaleway.com/ Virtual SSD Cloud Servers / Starter )
But, for personal reasons, the tests were postponed indefinitely.
And now I`m Back
In Release 0.0.3 :
Ready Frameworks for test
- Phalcon 3.2
- Laravel 5.4
Some server parameters are changed:
- php 7.0.20 -> php 7.1.10
- mariadb 5.5.52 -> 10.2.8-MariaDB
Let's compare #phalcon and #laravel in new conditionals
| framework | requests per second | relative | peak memory | relative |
|---|---|---|---|---|
| phalcon-index | 262.74 | 6,568.5 | 0.44 | 1.0 |
| phalcon-authors | 25.97 | 649.3 | 0.56 | 1.3 |
| phalcon-categories | 13.93 | 348.3 | 0.57 | 1.3 |
| laravel-index | 9.46 | 236.5 | 6.21 | 14.2 |
| laravel-categories | 6.47 | 161.8 | 7.51 | 17.2 |
| laravel-authors | 6.25 | 156.3 | 7.34 | 16.8 |
| phalcon-posts | 0.09 | 2.3 | 2.24 | 5.1 |
| laravel-posts | 0.04 | 1.0 | 15.13 | 34.7 |
Most of all I'm interested in the time of generation of a page with posts.
- Phalcon-posts ~ 2.3s
- Laravel-posts ~5.1s
Results almost coincide with previous tests.
Roadmap:
- Try to use Cache for all frameworks
- Implementing a test application and running tests on Symfony
- Implementing a test application and running tests on Yii
- Connection with https://blackfire.io/
- Deal with the Docker and wrap it all up in it. To be able to quickly deploy to a more powerful server for comparison.
PS: More information about structure of test application
Part 1. Introduction. - Why i decide to do new bencmark of php frameworks.
Part 2. Database scheme and generating data for testing app. - Description of application, database structure and data.
Posted on Utopian.io - Rewarding Open Source Contributors