Skip to content

Commit bb4991c

Browse files
committed
Update README.md & screenshots
1 parent 69303ae commit bb4991c

File tree

5 files changed

+62
-75
lines changed

5 files changed

+62
-75
lines changed

README.md

100644100755
Lines changed: 62 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Components like Template engines or ORM/Database libraries are out of scope in t
1818
- [Commands](#commands)
1919
- [Benchmarks](#benchmarks)
2020
- [Latest](#latest)
21-
- [Old](#old)
2221
- [OPCache](#results-with-opcache)
2322
- [References](#references)
2423
- [License](#license)
@@ -29,64 +28,73 @@ Components like Template engines or ORM/Database libraries are out of scope in t
2928

3029
This is `master` branch.
3130

32-
* Install a framework according to the official documentation.
31+
* Install a framework via `composer` according to the official documentation.
3332
* Use the default configuration.
3433
* Don't remove any components/configurations even if they are not used.
3534
* With minimum changes to run this benchmark.
3635
* Set environment production/Turn off debug mode.
3736
* Run the general optimization in your production environment, like `--optimize-autoloader` for the composer.
38-
* Use controller or action class.
37+
* Use controller class.
3938

40-
Some frameworks are optimized, some are not, so some people may think using default configuration is not fair. The dept of optimizing a framework depends on the developer's knowledge & experienced, it's the rabbit hole and there is no point in that for benchmarking. I think the default configuration of frameworks is a good starting point to have the ranking points.
39+
Some frameworks are optimized, some are not, so some people may think using default configuration is not fair. The dept of optimizing a framework depends on the developer's experienced too, so it's the rabbit hole and there is no point in that for benchmarking. I think the default configuration of frameworks is a good starting point to have the ranking points.
4140

42-
If you find something wrong with my code, please feel free to send Pull Requests. But please note optimizing for the "Hello World" is not acceptable! Building the fastest "Hello World" application is not the goal of this project.
41+
If you find something wrong with my code, feel free to send PR. But please note optimizing for the "Hello World" is not acceptable! Building the fastest "Hello World" application is not the goal of this project.
4342

4443

4544
## How to Benchmark
4645

4746
If you want to benchmark PHP extension frameworks like Phalcon, you need to install the extenstions.
4847

49-
1- Install source code as <http://localhost/php-frameworks-bench/>:
48+
1- Download & install the library in your localhost:
5049

5150
```
52-
# you can use --branch vx.x
51+
# instead you can use --branch vx.x
5352
$ git clone https://github.com/myaghobi/php-frameworks-bench.git
5453
$ cd php-frameworks-bench
54+
# run the setup & follow the progress
5555
$ bash setup.sh
5656
```
5757

58-
2- Run benchmarks:
58+
2- To make sure everything is ok:
59+
60+
```
61+
# this is optional
62+
$ bash check.sh
63+
```
64+
65+
3- Run benchmarks:
5966

6067
```
6168
$ bash benchmark.sh
6269
```
6370

64-
3- Check the resuts:
71+
4- Check the resuts:
6572

6673
<http://localhost/php-frameworks-bench/>
6774

75+
6876
## Commands
6977

7078
```
71-
# install | create-project frameworks
72-
$ bash setup.sh
73-
74-
# run the benchmark
75-
$ bash benchmark.sh
76-
77-
# composer update
79+
# composer update for each framework
7880
$ bash update.sh
7981
8082
# to clean them all
81-
# then you can use setup.sh
82-
# trobble? use it with `sudo`
83+
# trouble? run it then
84+
# you can use setup.sh
8385
$ bash clean.sh
86+
87+
# clear the cache of frameworks
88+
$ bash clear-cache.sh
89+
90+
# show the table of last benchmark
91+
$ bash show-table.sh
8492
```
8593

8694
To specify the frameworks, put them after each command:
8795

8896
```
89-
$ bash benchmark.sh laravel-9.1.3/ slim-4.10/ fatfree-3.7.3/
97+
$ bash benchmark.sh laravel-9.1/ slim-4.10/ fatfree-3.8.0/
9098
...
9199
```
92100

@@ -97,13 +105,15 @@ $ bash benchmark.sh laravel-9.1.3/ slim-4.10/ fatfree-3.7.3/
97105

98106
#### Environment
99107

100-
* Ubuntu 20.04 LTS 64bit
101-
* PHP 8.1.4 (LAMP)
102-
* CPU Core i7 [email protected]
108+
* Ubuntu 22.04 LTS 64bit
109+
* PHP 8.1.5
110+
* OPCache disabled
111+
* Apache 2.4.52
112+
* CPU Core i7 2600K@4Ghz
103113
* Memory 16G
104114

105115

106-
#### Results (2022/5/9)
116+
#### Results (2022/5/15)
107117

108118
These are my benchmarks, not yours. **I encourage you to run on your (production equivalent) environments.**
109119

@@ -112,59 +122,32 @@ These are my benchmarks, not yours. **I encourage you to run on your (production
112122
![Benchmark Results Graph Execution Time](screenshots/php-frameworks-bench-exectime.png)
113123
![Benchmark Results Graph Included Files](screenshots/php-frameworks-bench-includedfiles.png)
114124

115-
PHP 8.1.4 (LAMP)
116-
|framework |requests per second|relative|peak memory|relative|
117-
|-------------------|------------------:|-------:|----------:|-------:|
118-
|pure-php | 25,363.33|25,363.3| 0.34| 0.3|
119-
|phroute-2.1 | 20,871.63|20,871.6| 0.34| 0.3|
120-
|fastroute-1.3 | 20,692.36|20,692.4| 0.34| 0.3|
121-
|siler-1.7.9 | 15,140.00|15,140.0| 0.36| 0.4|
122-
|fatfree-3.8.0 | 13,172.39|13,172.4| 0.39| 0.4|
123-
|slim-4.10 | 10,863.08|10,863.1| 0.38| 0.4|
124-
|slim-3.12 | 10,630.10|10,630.1| 0.39| 0.4|
125-
|yii-2.0-basic | 8,382.51| 8,382.5| 0.69| 0.7|
126-
|silex-2.3 | 8,017.40| 8,017.4| 0.39| 0.4|
127-
|symfony-5.4 | 7,309.46| 7,309.5| 0.46| 0.5|
128-
|symfony-6.0 | 7,272.85| 7,272.9| 0.45| 0.5|
129-
|lumen-9.0.0 | 4,990.60| 4,990.6| 0.39| 0.4|
130-
|cakephp-4.3 | 4,471.16| 4,471.2| 0.43| 0.4|
131-
|fuelphp-1.9 | 3,728.35| 3,728.4| 0.45| 0.5|
132-
|codeigniter-4.1.9 | 1,671.15| 1,671.2| 1.46| 1.5|
133-
|laravel-9.1.3 | 826.64| 826.6| 0.77| 0.8|
134-
135-
136-
### Old
137-
138-
#### Environment
139-
140-
* Windows 10 64bit (bash executed on WSL 2)
141-
* PHP 8.0 (XAMPP x64)
142-
* CPU Core i7 [email protected]
143-
* Memory 16G
144-
145-
146-
#### Results (2021/12/01)
147-
148125
|framework |requests per second|relative|peak memory|relative|
149126
|-------------------|------------------:|-------:|----------:|-------:|
150-
|pure-php | 2,476.19| 2,476.2| 0.42| 0.4|
151-
|fastroute-1.3 | 1,208.93| 1,208.9| 0.57| 0.6|
152-
|phroute-2.1 | 1,201.83| 1,201.8| 0.58| 0.6|
153-
|fatfree-3.7.3 | 695.23| 695.2| 1.67| 1.7|
154-
|siler-1.7.9 | 520.31| 520.3| 1.19| 1.2|
155-
|yii-2.0.14-basic | 269.47| 269.5| 2.76| 2.8|
156-
|slim-4.9 | 239.09| 239.1| 1.60| 1.6|
157-
|silex-2.3 | 224.29| 224.3| 2.28| 2.3|
158-
|slim-4.3 | 223.43| 223.4| 1.55| 1.6|
159-
|fuelphp-1.8 | 180.84| 180.8| 2.72| 2.7|
160-
|lumen-8.1.2 | 162.19| 162.2| 3.45| 3.5|
161-
|cakephp-4.3 | 108.52| 108.5| 4.49| 4.5|
162-
|symfony-5.3 | 96.57| 96.6| 5.49| 5.5|
163-
|codeigniter-4.1.5 | 75.94| 75.9| 3.37| 3.4|
164-
|laravel-8.6.6 | 39.96| 40.0| 11.90| 11.9|
165-
166-
167-
### Results with OPCache
127+
|pure-php | 22,427.34|22,427.3| 0.42| 0.4|
128+
|fastroute-1.3 | 4,224.76| 4,224.8| 0.56| 0.6|
129+
|phroute-2.2 | 3,901.59| 3,901.6| 0.58| 0.6|
130+
|leaf-3.0 | 1,539.38| 1,539.4| 1.05| 1.1|
131+
|fatfree-3.8.0 | 1,414.71| 1,414.7| 1.67| 1.7|
132+
|siler-1.7.9 | 1,314.15| 1,314.2| 1.17| 1.2|
133+
|frameworkx-dev | 972.97| 973.0| 1.41| 1.4|
134+
|slim-3.12 | 969.54| 969.5| 1.40| 1.4|
135+
|slim-4.10 | 752.96| 753.0| 1.60| 1.6|
136+
|yii-2.0-basic | 510.90| 510.9| 2.72| 2.7|
137+
|silex-2.3 | 510.51| 510.5| 2.18| 2.2|
138+
|fuelphp-1.9 | 410.60| 410.6| 2.50| 2.5|
139+
|ubiquity-2.4.x.dev | 379.51| 379.5| 2.33| 2.3|
140+
|lumen-9.0 | 329.70| 329.7| 3.39| 3.4|
141+
|symfony-6.0 | 293.11| 293.1| 3.85| 3.9|
142+
|symfony-5.4 | 291.41| 291.4| 3.77| 3.8|
143+
|codeigniter-4.1 | 290.94| 290.9| 3.39| 3.4|
144+
|laminas-2.0.x.dev | 284.43| 284.4| 3.52| 3.5|
145+
|cakephp-4.3 | 232.68| 232.7| 4.45| 4.5|
146+
|laravel-9.1 | 93.47| 93.5| 11.04| 11.0|
147+
148+
149+
150+
### Results with OPCache (old version)
168151
[![IMAGE ALT TEXT](http://img.youtube.com/vi/BUcxalvD92U/0.jpg)](http://www.youtube.com/watch?v=BUcxalvD92U "PHP OPCache Benchmarks, a Comparison for Popular Frameworks")
169152

170153

@@ -176,19 +159,23 @@ Note: This project is based on
176159
* [CodeIgniter](https://github.com/codeigniter4/CodeIgniter4)
177160
* [FastRoute](https://github.com/nikic/FastRoute)
178161
* [FatFree](https://github.com/bcosca/fatfree)
162+
* [FrameworkX](https://github.com/clue/framework-x)
179163
* [FuelPHP](https://github.com/fuelphp/fuelphp)
164+
* [Laminas](https://github.com/laminas)
180165
* [Laravel](https://github.com/laravel/laravel)
166+
* [Leaf](https://github.com/leafsphp/leaf)
181167
* [Lumen](https://github.com/laravel/lumen)
182168
* [PhRoute](https://github.com/mrjgreen/phroute)
183169
* [Siler](https://github.com/leocavalcante/siler)
184170
* [Silex](https://github.com/silexphp/Silex)
185171
* [Slim](https://github.com/slimphp/Slim)
186172
* [Symfony](https://github.com/symfony/symfony)
173+
* [Ubiquity](https://github.com/phpMv/ubiquity)
187174
* [Yii](https://github.com/yiisoft/yii2)
188175

189176

190177
## License
191178

192-
You are allowed to use this plugin under the terms of the GNU General Public License version 2.
179+
You are allowed to use this plugin/project under the terms of the GNU General Public License version 2.
193180

194181
Copyright (C) 2022 Mohammad Yaghobi

screenshots/php-frameworks-bench-exectime.png

100644100755
File mode changed.

screenshots/php-frameworks-bench-includedfiles.png

100644100755
File mode changed.

screenshots/php-frameworks-bench-memory.png

100644100755
File mode changed.

screenshots/php-frameworks-bench-throughput.png

100644100755
File mode changed.

0 commit comments

Comments
 (0)