Skip to content

Commit 5edd027

Browse files
committed
Create configuration files for benchmark kit
1 parent 23098b8 commit 5edd027

File tree

10 files changed

+281
-237
lines changed

10 files changed

+281
-237
lines changed

.phpbenchmarks/codeLink.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
declare -A codeLinks=(
4+
[controller]="http://www.test.com"
5+
[route]="http://"
6+
)

.phpbenchmarks/configuration.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
readonly PHPBENCHMARKS_PHP_5_6_ENABLED=false
4+
readonly PHPBENCHMARKS_PHP_7_0_ENABLED=false
5+
readonly PHPBENCHMARKS_PHP_7_1_ENABLED=true
6+
readonly PHPBENCHMARKS_PHP_7_2_ENABLED=true
7+
readonly PHPBENCHMARKS_PHP_7_3_ENABLED=true
8+
9+
readonly PHPBENCHMARKS_NAME="Symfony"
10+
readonly PHPBENCHMARKS_SLUG="symfony"
11+
12+
readonly PHPBENCHMARKS_BENCHMARK_URL="/benchmark/helloworld"
13+
14+
readonly PHPBENCHMARKS_MAIN_REPOSITORY="symfony/framework-bundle"
15+
16+
readonly PHPBENCHMARKS_MAJOR_VERSION=4
17+
readonly PHPBENCHMARKS_MINOR_VERSION=2
18+
readonly PHPBENCHMARKS_BUGFIX_VERSION=2
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
#!/usr/bin/env bash
22

33
function clearCacheAndLogs() {
4-
sudo /bin/rm -rf var/cache/*
4+
rm -rf var/cache/*
55
[ "$?" != "0" ] && exit 1
6-
sudo /bin/chmod -R 777 var/cache
6+
chmod -R 777 var/cache
77
[ "$?" != "0" ] && exit 1
88

9-
sudo /bin/rm -rf var/log/*
9+
rm -rf var/log/*
1010
[ "$?" != "0" ] && exit 1
11-
sudo /bin/chmod -R 777 var/log
11+
chmod -R 777 var/log
1212
[ "$?" != "0" ] && exit 1
1313
}
1414

15-
function init() {
16-
export APP_ENV='prod'
17-
18-
sudo /bin/rm -rf vendor/
15+
function initBenchmark() {
1916
clearCacheAndLogs
2017

2118
composer install --no-dev --classmap-authoritative
2219
[ "$?" != "0" ] && exit 1
2320

2421
clearCacheAndLogs
2522
php bin/console cache:warmup
23+
[ "$?" != "0" ] && exit 1
2624

2725
return 0
2826
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hello World !

.phpbenchmarks/vhost.conf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
server {
2+
listen 80;
3+
server_name ____HOST____;
4+
root ____PROJECT_DIR____/public;
5+
location / {
6+
try_files $uri /index.php$is_args$args;
7+
}
8+
location ~ ^/(index).php(/|$) {
9+
fastcgi_pass unix:/run/php/____PHP_FPM_SOCK____;
10+
fastcgi_split_path_info ^(.+.php)(/.*)$;
11+
include fastcgi_params;
12+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
13+
fastcgi_param HTTPS off;
14+
fastcgi_param APP_ENV prod;
15+
fastcgi_param APP_DEBUG false;
16+
}
17+
error_log /var/log/nginx/benchmark_error.log;
18+
access_log /var/log/nginx/benchmark_access.log;
19+
}

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,27 @@
66

77
## What is www.phpbenchmarks.com ?
88

9-
You will find lot of benchmarks for PHP frameworks and template engines.
9+
You will find lot of benchmarks for PHP frameworks and template engines on [phpbenchmarks.com](http://www.phpbenchmarks.com).
1010

11-
You can compare results between Apache Bench and Siege, and PHP 5.6 to 7.3.
11+
Benchmarks results are available for Apache Bench and Siege, and PHP 5.6 to 7.3.
12+
13+
Our benchmarking protocol is available on [benchmarking protocol page](http://www.phpbenchmarks.com/en/documentation/benchmarking-protocol).
1214

1315
## What is this repository ?
1416

15-
It's benchmark common code for Symfony benchmarks.
17+
It contains Symfony installation `only`.
18+
To reuse code between minor versions, features for benchmarks are not coded in this repository
19+
but in [phpbenchmarks/symfony-common](https://github.com/phpbenchmarks/symfony-common) repository.
1620

17-
Switch branch to select your Symfony major version and benchmark you want to see.
21+
Switch branch to select version and benchmark you want to see.
1822

19-
See all Symfony benchmarked versions on [phpbenchmarks/symfony](https://github.com/phpbenchmarks/symfony).
23+
## Benchmarks
2024

21-
You can find how we benchmark on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark-protocol.html).
25+
You can find Symfony 4.2 benchmarks results on
26+
[benchmarks results page](http://www.phpbenchmarks.com/en/benchmark/symfony/4.2).
2227

23-
## Benchmarks
28+
See all Symfony benchmarked versions on [select version page](http://www.phpbenchmarks.com/en/benchmark/symfony/version).
2429

25-
You can find all Symfony benchmarks results on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark/symfony.html).
30+
## Community
2631

27-
Scores are too low ? Do not hesitate to create a pull request, and ask a new benchmark !
32+
Go to [community page](http://www.phpbenchmarks.com/en/community) to see the Hall of fame, or download the benchmark kit to add your code!

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"php": "^7.1.3",
77
"ext-ctype": "*",
88
"ext-iconv": "*",
9-
"symfony/console": "4.2.*",
9+
"symfony/console": "4.2.2",
1010
"symfony/flex": "^1.1",
11-
"symfony/framework-bundle": "4.2.*",
12-
"symfony/yaml": "4.2.*",
11+
"symfony/framework-bundle": "4.2.2",
12+
"symfony/yaml": "4.2.2",
1313
"phpbenchmarks/symfony-common": "4.1.1"
1414
},
1515
"config": {
@@ -50,7 +50,7 @@
5050
"extra": {
5151
"symfony": {
5252
"allow-contrib": false,
53-
"require": "4.2.*"
53+
"require": "4.2.2"
5454
}
5555
}
5656
}

0 commit comments

Comments
 (0)