From 86f0d49862a3d33ca25a3b583e52c8bbd37998d0 Mon Sep 17 00:00:00 2001 From: Steevan BARBOYON Date: Tue, 14 Jan 2020 10:11:40 +0100 Subject: [PATCH] Compatibility with benchmark 4.0.0-DEV --- .circleci/config.yml | 21 ++++ .gitignore | 5 +- .phpbenchmarks/config.yml | 23 ++++ .phpbenchmarks/nginx/vhost.conf | 15 +++ .../php/5.6/composer.lock | 4 +- .phpbenchmarks/php/5.6/initBenchmark.sh | 5 + .phpbenchmarks/php/5.6/php.ini | 0 .../php/5.6/responseBody/responseBody.html | 0 README.md | 39 +++++-- composer.json | 2 +- init_benchmark.sh | 8 -- public/index.php | 110 +++++++++--------- {public => src}/benchmark_generator.php | 0 {overload => src}/blocks.php | 0 {overload => src}/functions.php | 0 {overload => src}/macros.php | 0 {overload => templates/layout}/layout_end.php | 0 .../layout}/layout_start.php | 2 +- .../template}/template1.php | 0 .../template}/template10.php | 0 .../template}/template11.php | 0 .../template}/template12.php | 0 .../template}/template13.php | 0 .../template}/template14.php | 0 .../template}/template15.php | 0 .../template}/template16.php | 0 .../template}/template17.php | 0 .../template}/template18.php | 0 .../template}/template19.php | 0 .../template}/template2.php | 0 .../template}/template20.php | 0 .../template}/template21.php | 0 .../template}/template22.php | 0 .../template}/template23.php | 0 .../template}/template24.php | 0 .../template}/template25.php | 0 .../template}/template26.php | 0 .../template}/template27.php | 0 .../template}/template28.php | 0 .../template}/template29.php | 0 .../template}/template3.php | 0 .../template}/template30.php | 0 .../template}/template31.php | 0 .../template}/template32.php | 0 .../template}/template33.php | 0 .../template}/template34.php | 0 .../template}/template35.php | 0 .../template}/template36.php | 0 .../template}/template37.php | 0 .../template}/template38.php | 0 .../template}/template39.php | 0 .../template}/template4.php | 0 .../template}/template40.php | 0 .../template}/template41.php | 0 .../template}/template42.php | 0 .../template}/template43.php | 0 .../template}/template44.php | 0 .../template}/template45.php | 0 .../template}/template46.php | 0 .../template}/template47.php | 0 .../template}/template48.php | 0 .../template}/template49.php | 0 .../template}/template5.php | 0 .../template}/template50.php | 0 .../template}/template6.php | 0 .../template}/template7.php | 0 .../template}/template8.php | 0 .../template}/template9.php | 0 68 files changed, 152 insertions(+), 82 deletions(-) create mode 100644 .circleci/config.yml create mode 100644 .phpbenchmarks/config.yml create mode 100644 .phpbenchmarks/nginx/vhost.conf rename composer.lock.php5.6 => .phpbenchmarks/php/5.6/composer.lock (85%) create mode 100755 .phpbenchmarks/php/5.6/initBenchmark.sh create mode 100644 .phpbenchmarks/php/5.6/php.ini rename response.html => .phpbenchmarks/php/5.6/responseBody/responseBody.html (100%) delete mode 100755 init_benchmark.sh rename {public => src}/benchmark_generator.php (100%) rename {overload => src}/blocks.php (100%) rename {overload => src}/functions.php (100%) rename {overload => src}/macros.php (100%) rename {overload => templates/layout}/layout_end.php (100%) rename {overload => templates/layout}/layout_start.php (96%) rename {overload/templates => templates/template}/template1.php (100%) rename {overload/templates => templates/template}/template10.php (100%) rename {overload/templates => templates/template}/template11.php (100%) rename {overload/templates => templates/template}/template12.php (100%) rename {overload/templates => templates/template}/template13.php (100%) rename {overload/templates => templates/template}/template14.php (100%) rename {overload/templates => templates/template}/template15.php (100%) rename {overload/templates => templates/template}/template16.php (100%) rename {overload/templates => templates/template}/template17.php (100%) rename {overload/templates => templates/template}/template18.php (100%) rename {overload/templates => templates/template}/template19.php (100%) rename {overload/templates => templates/template}/template2.php (100%) rename {overload/templates => templates/template}/template20.php (100%) rename {overload/templates => templates/template}/template21.php (100%) rename {overload/templates => templates/template}/template22.php (100%) rename {overload/templates => templates/template}/template23.php (100%) rename {overload/templates => templates/template}/template24.php (100%) rename {overload/templates => templates/template}/template25.php (100%) rename {overload/templates => templates/template}/template26.php (100%) rename {overload/templates => templates/template}/template27.php (100%) rename {overload/templates => templates/template}/template28.php (100%) rename {overload/templates => templates/template}/template29.php (100%) rename {overload/templates => templates/template}/template3.php (100%) rename {overload/templates => templates/template}/template30.php (100%) rename {overload/templates => templates/template}/template31.php (100%) rename {overload/templates => templates/template}/template32.php (100%) rename {overload/templates => templates/template}/template33.php (100%) rename {overload/templates => templates/template}/template34.php (100%) rename {overload/templates => templates/template}/template35.php (100%) rename {overload/templates => templates/template}/template36.php (100%) rename {overload/templates => templates/template}/template37.php (100%) rename {overload/templates => templates/template}/template38.php (100%) rename {overload/templates => templates/template}/template39.php (100%) rename {overload/templates => templates/template}/template4.php (100%) rename {overload/templates => templates/template}/template40.php (100%) rename {overload/templates => templates/template}/template41.php (100%) rename {overload/templates => templates/template}/template42.php (100%) rename {overload/templates => templates/template}/template43.php (100%) rename {overload/templates => templates/template}/template44.php (100%) rename {overload/templates => templates/template}/template45.php (100%) rename {overload/templates => templates/template}/template46.php (100%) rename {overload/templates => templates/template}/template47.php (100%) rename {overload/templates => templates/template}/template48.php (100%) rename {overload/templates => templates/template}/template49.php (100%) rename {overload/templates => templates/template}/template5.php (100%) rename {overload/templates => templates/template}/template50.php (100%) rename {overload/templates => templates/template}/template6.php (100%) rename {overload/templates => templates/template}/template7.php (100%) rename {overload/templates => templates/template}/template8.php (100%) rename {overload/templates => templates/template}/template9.php (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..041b39b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,21 @@ +version: '2.1' + +jobs: + ValidateBenchmark: + docker: + - image: phpbenchmarks/benchmark-kit:4 + working_directory: /var/www/benchmark + steps: + - checkout + - run: + name: /var/entrypoint.sh + command: /var/entrypoint.sh --nginx-as-service + - run: + name: "benchmark:validate" + command: "/var/benchmark-kit/bin/console benchmark:validate:all" + +workflows: + version: '2.1' + BenchmarkKit: + jobs: + - ValidateBenchmark diff --git a/.gitignore b/.gitignore index 072705c..ff72e2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -.idea/ -vendor/ -composer.lock +/composer.lock +/vendor diff --git a/.phpbenchmarks/config.yml b/.phpbenchmarks/config.yml new file mode 100644 index 0000000..16acf82 --- /dev/null +++ b/.phpbenchmarks/config.yml @@ -0,0 +1,23 @@ +component: + id: 1 +benchmark: + type: 4 + relativeUrl: / +sourceCode: + entryPoint: public/index.php + urls: + template: 'https://github.com/phpbenchmarks/php/tree/5.6.40_templating-small-overload_0/public/index.php' + templatingLayout: 'https://github.com/phpbenchmarks/php/tree/5.6.40_templating-small-overload_0/public/index.php#L6' + templatingBlocks: 'https://github.com/phpbenchmarks/php/tree/5.6.40_templating-small-overload_0/templates/layout/layout_start.php#L31' + templatingFunctions: 'https://github.com/phpbenchmarks/php/tree/5.6.40_templating-small-overload_0/public/index.php#L8' + templatingMacros: 'https://github.com/phpbenchmarks/php/tree/5.6.40_templating-small-overload_0/public/index.php#L432' + templatingEscapeStringHtml: 'https://github.com/phpbenchmarks/php/tree/5.6.40_templating-small-overload_0/public/index.php#856' + templatingEscapeStringJs: 'https://github.com/phpbenchmarks/php/tree/5.6.40_templating-small-overload_0/public/index.php#2877' + templatingVariables: 'https://github.com/phpbenchmarks/php/tree/5.6.40_templating-small-overload_0/public/index.php#L5933' + templatingOutputRaw: 'https://github.com/phpbenchmarks/php/tree/5.6.40_templating-small-overload_0/public/index.php#L5933' + templatingOutputUnknownVariables: 'https://github.com/phpbenchmarks/php/tree/5.6.40_templating-small-overload_0/public/index.php#L6855' + templatingOutputMethodCalls: 'https://github.com/phpbenchmarks/php/tree/5.6.40_templating-small-overload_0/public/index.php#L7277' + templatingIncludeTemplates: 'https://github.com/phpbenchmarks/php/tree/5.6.40_templating-small-overload_0/public/index.php#L9308' +coreDependency: + name: php + version: 5.6.40 diff --git a/.phpbenchmarks/nginx/vhost.conf b/.phpbenchmarks/nginx/vhost.conf new file mode 100644 index 0000000..d7dba5a --- /dev/null +++ b/.phpbenchmarks/nginx/vhost.conf @@ -0,0 +1,15 @@ +server { + listen ____PORT____; + server_name ____HOST____; + root ____INSTALLATION_PATH____/public; + location / { + try_files $uri /index.php$is_args$args; + } + location ~ ^/(index).php(/|$) { + fastcgi_pass unix:/run/php/____PHP_FPM_SOCK____; + fastcgi_split_path_info ^(.+.php)(/.*)$; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param HTTPS off; + } +} diff --git a/composer.lock.php5.6 b/.phpbenchmarks/php/5.6/composer.lock similarity index 85% rename from composer.lock.php5.6 rename to .phpbenchmarks/php/5.6/composer.lock index 6b1b721..3991a4e 100644 --- a/composer.lock.php5.6 +++ b/.phpbenchmarks/php/5.6/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d3b724a035464168e5feaa305daf696f", + "content-hash": "32761ae15297156b48535e8909f2457f", "packages": [], "packages-dev": [], "aliases": [], @@ -13,7 +13,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "5.6.*" + "php": "5.6.40" }, "platform-dev": [] } diff --git a/.phpbenchmarks/php/5.6/initBenchmark.sh b/.phpbenchmarks/php/5.6/initBenchmark.sh new file mode 100755 index 0000000..f61c58a --- /dev/null +++ b/.phpbenchmarks/php/5.6/initBenchmark.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +composer install --no-dev --classmap-authoritative --ansi diff --git a/.phpbenchmarks/php/5.6/php.ini b/.phpbenchmarks/php/5.6/php.ini new file mode 100644 index 0000000..e69de29 diff --git a/response.html b/.phpbenchmarks/php/5.6/responseBody/responseBody.html similarity index 100% rename from response.html rename to .phpbenchmarks/php/5.6/responseBody/responseBody.html diff --git a/README.md b/README.md index 21a0fe3..0979e5c 100644 --- a/README.md +++ b/README.md @@ -4,24 +4,41 @@ www.phpbenchmarks.com

-## What is www.phpbenchmarks.com ? +## What is www.phpbenchmarks.com? -You will find lot of benchmarks for PHP frameworks and template engines. +You will find a lot of benchmarks for PHP and PHP libraries on [phpbenchmarks.com](http://www.phpbenchmarks.com). -You can compare results between Apache Bench and Siege, and PHP 5.6 to 7.2. +Benchmarks results are available from PHP 5.6 to latest version. -## What is this repository ? +Our benchmarking protocol is available on [benchmarking protocol page](http://www.phpbenchmarks.com/en/documentation/benchmarking-protocol). -It's benchmark common code for PHP benchmarks. +## What is this repository? -Switch branch to select your PHP major version and benchmark you want to see. +It contains PHP benchmark code. -See all PHP benchmarked versions on [phpbenchmarks/php](https://github.com/phpbenchmarks/php). - -You can find how we benchmark on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark-protocol.html). +Switch branch to select version and benchmark you want to see. ## Benchmarks -You can find all PHP benchmarks results on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark/php.html). +You can find PHP 5.6 benchmarks results on +[benchmarks results page](http://www.phpbenchmarks.com/en/benchmark/php/5.6). + +See all PHP benchmarked versions on [select version page](http://www.phpbenchmarks.com/en/benchmark/php/version). + +## Community + +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! + +## How version works? + +We do not follow semantic version for this repository. + +Here is an explanation about our versioning system: + +`X.Y.Z_benchmark-slug_W` -Scores are too low ? Do not hesitate to create a pull request, and ask a new benchmark ! +* `X`: PHP major version. +* `Y`: PHP minor version. +* `Z`: PHP patch version. +* `benchmark-slug`: slug of the benchmark, list available on [documentation page](http://www.phpbenchmarks.com/en/documentation). +* `W`: benchmark version diff --git a/composer.json b/composer.json index 12d69a7..352f19f 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,6 @@ "license": "proprietary", "type": "project", "require": { - "php": "5.6.*" + "php": "5.6.40" } } diff --git a/init_benchmark.sh b/init_benchmark.sh deleted file mode 100755 index 9ee4ef3..0000000 --- a/init_benchmark.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -function init() { - composer install --no-dev --classmap-authoritative - [ "$?" != "0" ] && exit 1 - - return 0 -} diff --git a/public/index.php b/public/index.php index 0563b57..3bbccfa 100644 --- a/public/index.php +++ b/public/index.php @@ -3,14 +3,14 @@ // This code has to fill OPCache, so we will not use loop and write duplicated code // Simulate an extends -include(__DIR__ . '/../overload/layout_start.php'); +include(__DIR__ . '/../templates/layout/layout_start.php'); ?>
@@ -434,7 +434,7 @@ // Create 100 macros and call them all // ------------------------------------------------------------------------------------------------------------- - require __DIR__ . '/../overload/macros.php'; + require __DIR__ . '/../src/macros.php'; ?>
@@ -9324,252 +9324,252 @@ public function phpBenchmarks() @@ -9579,7 +9579,5 @@ public function phpBenchmarks() diff --git a/public/benchmark_generator.php b/src/benchmark_generator.php similarity index 100% rename from public/benchmark_generator.php rename to src/benchmark_generator.php diff --git a/overload/blocks.php b/src/blocks.php similarity index 100% rename from overload/blocks.php rename to src/blocks.php diff --git a/overload/functions.php b/src/functions.php similarity index 100% rename from overload/functions.php rename to src/functions.php diff --git a/overload/macros.php b/src/macros.php similarity index 100% rename from overload/macros.php rename to src/macros.php diff --git a/overload/layout_end.php b/templates/layout/layout_end.php similarity index 100% rename from overload/layout_end.php rename to templates/layout/layout_end.php diff --git a/overload/layout_start.php b/templates/layout/layout_start.php similarity index 96% rename from overload/layout_start.php rename to templates/layout/layout_start.php index c7e11f1..4f806e0 100644 --- a/overload/layout_start.php +++ b/templates/layout/layout_start.php @@ -12,7 +12,7 @@ // Create 50 blocks and fill them all // ------------------------------------------------------------------------------------------------------------- - require __DIR__ . '/../overload/blocks.php'; + require __DIR__ . '/../../src/blocks.php'; ?>
diff --git a/overload/templates/template1.php b/templates/template/template1.php similarity index 100% rename from overload/templates/template1.php rename to templates/template/template1.php diff --git a/overload/templates/template10.php b/templates/template/template10.php similarity index 100% rename from overload/templates/template10.php rename to templates/template/template10.php diff --git a/overload/templates/template11.php b/templates/template/template11.php similarity index 100% rename from overload/templates/template11.php rename to templates/template/template11.php diff --git a/overload/templates/template12.php b/templates/template/template12.php similarity index 100% rename from overload/templates/template12.php rename to templates/template/template12.php diff --git a/overload/templates/template13.php b/templates/template/template13.php similarity index 100% rename from overload/templates/template13.php rename to templates/template/template13.php diff --git a/overload/templates/template14.php b/templates/template/template14.php similarity index 100% rename from overload/templates/template14.php rename to templates/template/template14.php diff --git a/overload/templates/template15.php b/templates/template/template15.php similarity index 100% rename from overload/templates/template15.php rename to templates/template/template15.php diff --git a/overload/templates/template16.php b/templates/template/template16.php similarity index 100% rename from overload/templates/template16.php rename to templates/template/template16.php diff --git a/overload/templates/template17.php b/templates/template/template17.php similarity index 100% rename from overload/templates/template17.php rename to templates/template/template17.php diff --git a/overload/templates/template18.php b/templates/template/template18.php similarity index 100% rename from overload/templates/template18.php rename to templates/template/template18.php diff --git a/overload/templates/template19.php b/templates/template/template19.php similarity index 100% rename from overload/templates/template19.php rename to templates/template/template19.php diff --git a/overload/templates/template2.php b/templates/template/template2.php similarity index 100% rename from overload/templates/template2.php rename to templates/template/template2.php diff --git a/overload/templates/template20.php b/templates/template/template20.php similarity index 100% rename from overload/templates/template20.php rename to templates/template/template20.php diff --git a/overload/templates/template21.php b/templates/template/template21.php similarity index 100% rename from overload/templates/template21.php rename to templates/template/template21.php diff --git a/overload/templates/template22.php b/templates/template/template22.php similarity index 100% rename from overload/templates/template22.php rename to templates/template/template22.php diff --git a/overload/templates/template23.php b/templates/template/template23.php similarity index 100% rename from overload/templates/template23.php rename to templates/template/template23.php diff --git a/overload/templates/template24.php b/templates/template/template24.php similarity index 100% rename from overload/templates/template24.php rename to templates/template/template24.php diff --git a/overload/templates/template25.php b/templates/template/template25.php similarity index 100% rename from overload/templates/template25.php rename to templates/template/template25.php diff --git a/overload/templates/template26.php b/templates/template/template26.php similarity index 100% rename from overload/templates/template26.php rename to templates/template/template26.php diff --git a/overload/templates/template27.php b/templates/template/template27.php similarity index 100% rename from overload/templates/template27.php rename to templates/template/template27.php diff --git a/overload/templates/template28.php b/templates/template/template28.php similarity index 100% rename from overload/templates/template28.php rename to templates/template/template28.php diff --git a/overload/templates/template29.php b/templates/template/template29.php similarity index 100% rename from overload/templates/template29.php rename to templates/template/template29.php diff --git a/overload/templates/template3.php b/templates/template/template3.php similarity index 100% rename from overload/templates/template3.php rename to templates/template/template3.php diff --git a/overload/templates/template30.php b/templates/template/template30.php similarity index 100% rename from overload/templates/template30.php rename to templates/template/template30.php diff --git a/overload/templates/template31.php b/templates/template/template31.php similarity index 100% rename from overload/templates/template31.php rename to templates/template/template31.php diff --git a/overload/templates/template32.php b/templates/template/template32.php similarity index 100% rename from overload/templates/template32.php rename to templates/template/template32.php diff --git a/overload/templates/template33.php b/templates/template/template33.php similarity index 100% rename from overload/templates/template33.php rename to templates/template/template33.php diff --git a/overload/templates/template34.php b/templates/template/template34.php similarity index 100% rename from overload/templates/template34.php rename to templates/template/template34.php diff --git a/overload/templates/template35.php b/templates/template/template35.php similarity index 100% rename from overload/templates/template35.php rename to templates/template/template35.php diff --git a/overload/templates/template36.php b/templates/template/template36.php similarity index 100% rename from overload/templates/template36.php rename to templates/template/template36.php diff --git a/overload/templates/template37.php b/templates/template/template37.php similarity index 100% rename from overload/templates/template37.php rename to templates/template/template37.php diff --git a/overload/templates/template38.php b/templates/template/template38.php similarity index 100% rename from overload/templates/template38.php rename to templates/template/template38.php diff --git a/overload/templates/template39.php b/templates/template/template39.php similarity index 100% rename from overload/templates/template39.php rename to templates/template/template39.php diff --git a/overload/templates/template4.php b/templates/template/template4.php similarity index 100% rename from overload/templates/template4.php rename to templates/template/template4.php diff --git a/overload/templates/template40.php b/templates/template/template40.php similarity index 100% rename from overload/templates/template40.php rename to templates/template/template40.php diff --git a/overload/templates/template41.php b/templates/template/template41.php similarity index 100% rename from overload/templates/template41.php rename to templates/template/template41.php diff --git a/overload/templates/template42.php b/templates/template/template42.php similarity index 100% rename from overload/templates/template42.php rename to templates/template/template42.php diff --git a/overload/templates/template43.php b/templates/template/template43.php similarity index 100% rename from overload/templates/template43.php rename to templates/template/template43.php diff --git a/overload/templates/template44.php b/templates/template/template44.php similarity index 100% rename from overload/templates/template44.php rename to templates/template/template44.php diff --git a/overload/templates/template45.php b/templates/template/template45.php similarity index 100% rename from overload/templates/template45.php rename to templates/template/template45.php diff --git a/overload/templates/template46.php b/templates/template/template46.php similarity index 100% rename from overload/templates/template46.php rename to templates/template/template46.php diff --git a/overload/templates/template47.php b/templates/template/template47.php similarity index 100% rename from overload/templates/template47.php rename to templates/template/template47.php diff --git a/overload/templates/template48.php b/templates/template/template48.php similarity index 100% rename from overload/templates/template48.php rename to templates/template/template48.php diff --git a/overload/templates/template49.php b/templates/template/template49.php similarity index 100% rename from overload/templates/template49.php rename to templates/template/template49.php diff --git a/overload/templates/template5.php b/templates/template/template5.php similarity index 100% rename from overload/templates/template5.php rename to templates/template/template5.php diff --git a/overload/templates/template50.php b/templates/template/template50.php similarity index 100% rename from overload/templates/template50.php rename to templates/template/template50.php diff --git a/overload/templates/template6.php b/templates/template/template6.php similarity index 100% rename from overload/templates/template6.php rename to templates/template/template6.php diff --git a/overload/templates/template7.php b/templates/template/template7.php similarity index 100% rename from overload/templates/template7.php rename to templates/template/template7.php diff --git a/overload/templates/template8.php b/templates/template/template8.php similarity index 100% rename from overload/templates/template8.php rename to templates/template/template8.php diff --git a/overload/templates/template9.php b/templates/template/template9.php similarity index 100% rename from overload/templates/template9.php rename to templates/template/template9.php