You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -71,29 +74,13 @@ These are my benchmarks, not yours. **I encourage you to run on your (production
71
74
72
75
73
76
#### OPCache On
77
+
Check out the video for more information.
74
78
[](http://www.youtube.com/watch?v=Dk8YHQZ6jfY)
75
79
76
80
77
-
## Benchmarking Policy
78
-
79
-
This is for the `main` branch.
80
-
81
-
* Frameworks installed via `composer` according to their official documentation.
82
-
* Used the default configuration.
83
-
* Considering the minimum changes on frameworks to run the benchmark.
84
-
* Didn't remove any components/configurations even if there is no use for them.
85
-
* We have a `controller` class to get the `Hello World` for each, based on the default template of each framework.
86
-
* Turned off the `debug` mode and set the environment to `production` mode.
87
-
* Considered general optimization for the production environment, like `--optimize-autoloader` for the composer.
88
-
89
-
Some frameworks are optimized more than others, so some people may think using default configuration is not fair. The dept of optimizing a framework depends on the experiences of the developer too, so it's the rabbit hole and there is no point in it. I think the default configuration of frameworks is a good starting point to get ranking.
90
-
91
-
If you find something wrong in my code, feel free to send a 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.
92
-
93
-
94
81
## How to Benchmark
95
82
96
-
If you want to have benchmarks on `PHP extension frameworks` like `Phalcon`, you need to install the extension first based on its own documentation.
83
+
If you want to have benchmarks on `PHP extension frameworks` like `Phalcon`, you need to install the extension first, based on its own documentation.
97
84
98
85
1- Download & Setup:
99
86
@@ -115,32 +102,58 @@ $ yes | bash setup.sh
115
102
```bash
116
103
$ bash check.sh
117
104
# bash check.sh -t pure-php
118
-
#/------- pure-php: checking... done.
105
+
#✔ pure-php
119
106
```
120
107
121
108
3- Run benchmarks:
122
109
123
110
```bash
111
+
# bash benchmark.sh --help
124
112
$ bash benchmark.sh
125
113
```
126
114
127
115
4- Check the results:
128
116
- web:
129
117
130
-
<http://localhost/PHP-Frameworks-Bench/>
118
+
<http://127.0.0.1/PHP-Frameworks-Bench/>
131
119
132
120
- terminal:
133
-
```
121
+
```bash
122
+
# bash results.sh --help
134
123
bash results.sh
135
124
```
136
125
137
126
127
+
## Docker
128
+
129
+
Results with docker may not be reliable but in a situation you can use it like:
130
+
131
+
1- Change the `base` in `benchmark.config` on the right port(`8080` considered):
132
+
133
+
```ini
134
+
base="http://127.0.0.1:8080/PHP-Frameworks-Bench"
135
+
...
136
+
```
137
+
138
+
2- Run/download the docker:
139
+
140
+
```bash
141
+
$ bash docker-apache.sh
142
+
```
143
+
144
+
3- Run the benchmark:
145
+
146
+
```bash
147
+
# run it in another terminal
148
+
$ bash benchmark.sh
149
+
```
150
+
151
+
138
152
## Commands
139
153
140
154
```bash
141
-
# some options
142
155
# use bash benchmark.sh --help
143
-
$ bash benchmark.sh -f -rapache -rnginx -t ...
156
+
$ bash benchmark.sh -f -rapache -t pure-php
144
157
145
158
# run composer update for frameworks
146
159
$ bash update.sh
@@ -153,28 +166,47 @@ $ bash clean.sh
153
166
# clear the cache of frameworks
154
167
$ bash clear-cache.sh
155
168
156
-
# show the results of the last benchmark
169
+
# show the results table
157
170
$ bash results.sh
158
171
```
159
172
160
173
To specify frameworks, put them with `-t ...` after each command:
161
174
162
175
```bash
163
176
# supported for `setup.sh`, `benchmark.sh`, `update.sh`, `clean.sh`, and `clear-cache.sh`
164
-
# not required to put / after the name, just use the tab in your terminal
Check out the [Benchmarking Policy](#benchmarking-policy), to get more information watch the video [OPCache On/Off](#opcache-on).
185
+
186
+
187
+
## Benchmarking Policy
188
+
189
+
* Use `composer` to install frameworks according to their official documentation.
190
+
* Use the default configuration.
191
+
* Minimum changes on frameworks to have benchmarks.
192
+
* Don't remove any components/configurations even if there is no use for them.
193
+
* Include a `controller` class to get the `Hello World!` for each, based on the default template of each framework for `controllers`.
194
+
* Turn off the `debug` mode and set the environment to `production` mode.
195
+
* General optimization for the production environment, like `--optimize-autoloader` for the `composer`.
196
+
197
+
Some frameworks are optimized more than others, so some developers may think using default configuration is not fair. The dept of optimizing a framework depends on the skills/experiences of the developer too, so it's the rabbit hole and nonsense for ranking. Please **note** optimizing for the `Hello World` is not acceptable! Building the fastest `Hello World` application is not the goal of this project. I think the default configuration of frameworks is a good starting point to have a ranking.
198
+
199
+
If you find something wrong in my code, feel free to send a `PR`.
200
+
201
+
171
202
## 🍔 Donate
172
203
Don't forget to donate if you find it useful ☕ 🍺 🍸 🍔
[php-framework-benchmark](https://github.com/kenjis/php-framework-benchmark), thanks to [Kenjis](https://github.com/kenjis). It is very old and abandoned, so I decided to split it from the origin and update it separately.
0 commit comments