diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..85e4c3e --- /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: entrypoint + command: entrypoint --nginx-as-service + - run: + name: "validate:benchmark" + command: "phpbenchkit validate:benchmark -vvv" + +workflows: + version: '2.1' + BenchmarkKit: + jobs: + - ValidateBenchmark diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e0d383d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/.idea +/vendor +/composer.lock diff --git a/.phpbenchmarks/config.yml b/.phpbenchmarks/config.yml new file mode 100644 index 0000000..8e6d9b1 --- /dev/null +++ b/.phpbenchmarks/config.yml @@ -0,0 +1,12 @@ +component: + slug: php +benchmark: + type: json-serialization-hello-world + relativeUrl: / +sourceCode: + entryPoint: public/index.php + urls: + jsonSerialization: https://github.com/phpbenchmarks/php/tree/8.0.0_json-serialization-hello-world_0/public/index.php#L12 +coreDependency: + name: php + version: 8.0.0 diff --git a/.phpbenchmarks/nginx/vhost.conf b/.phpbenchmarks/nginx/vhost.conf new file mode 100644 index 0000000..9c166a9 --- /dev/null +++ b/.phpbenchmarks/nginx/vhost.conf @@ -0,0 +1,15 @@ +server { + listen ____PORT____; + server_name ____HOST____; + root ____INSTALLATION_PATH____/____ENTRY_POINT_FILE_PATH____; + location / { + try_files $uri /____ENTRY_POINT_FILE_NAME____$is_args$args; + } + location ~ ____ENTRY_POINT_FILE_NAME____(/|$) { + 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/.phpbenchmarks/php/8.0/composer.lock b/.phpbenchmarks/php/8.0/composer.lock new file mode 100644 index 0000000..7ba3a51 --- /dev/null +++ b/.phpbenchmarks/php/8.0/composer.lock @@ -0,0 +1,52 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "0c0625989f8d83f8b86f1bbfd2180ec8", + "packages": [ + { + "name": "phpbenchmarks/benchmark-json-serialization-hello-world", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpbenchmarks/benchmark-json-serialization-hello-world.git", + "reference": "9284d31f5ebf7fc9d61dec4e6caf93f45545d7bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpbenchmarks/benchmark-json-serialization-hello-world/zipball/9284d31f5ebf7fc9d61dec4e6caf93f45545d7bc", + "reference": "9284d31f5ebf7fc9d61dec4e6caf93f45545d7bc", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "type": "project", + "autoload": { + "psr-4": { + "PhpBenchmarks\\BenchmarkJsonSerializationHelloWorld\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "proprietary" + ], + "description": "Data for JSON serialization of Hello world benchmark on phpbenchmarks.com.", + "time": "2019-05-11T19:31:47+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "8.0.0", + "ext-json": "*" + }, + "platform-dev": [], + "plugin-api-version": "1.1.0" +} diff --git a/.phpbenchmarks/php/8.0/initBenchmark.sh b/.phpbenchmarks/php/8.0/initBenchmark.sh new file mode 100755 index 0000000..011058f --- /dev/null +++ b/.phpbenchmarks/php/8.0/initBenchmark.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -e + +# add commands to initialize benchmark: clear cache and logs, warm up cache etc +composer install --no-dev --classmap-authoritative --ansi diff --git a/.phpbenchmarks/php/8.0/php.ini b/.phpbenchmarks/php/8.0/php.ini new file mode 100644 index 0000000..c521d11 --- /dev/null +++ b/.phpbenchmarks/php/8.0/php.ini @@ -0,0 +1,31 @@ +; ---------------------------------------------------------------------------------------------------------------------- +; This file will be added to PHP ini files loaded before benchmarking. +; Configure what you need here. +; +; /!\ Do NOT configure opcache.enable: it will be configured automatically. +; /!\ Do NOT configure opcache.preload and opcache.preload_user: it will be configured automatically. /!\ +; ---------------------------------------------------------------------------------------------------------------------- + +; Examples of configuration you could change for your needs. + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 1000000 are allowed. +;opcache.max_accelerated_files=10000 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0x7FFFBFFF + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Enables or disables opcode caching in shared memory. +;opcache.file_cache_only=0 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=128 diff --git a/.phpbenchmarks/php/8.0/preload.php b/.phpbenchmarks/php/8.0/preload.php new file mode 100644 index 0000000..1d81ec7 --- /dev/null +++ b/.phpbenchmarks/php/8.0/preload.php @@ -0,0 +1,17 @@ + + +
+ www.phpbenchmarks.com +

+ +## What is www.phpbenchmarks.com? + +You will find a lot of benchmarks for PHP and PHP libraries on [phpbenchmarks.com](http://www.phpbenchmarks.com). + +Benchmarks results are available from PHP 5.6 to latest version. + +Our benchmarking protocol is available on [benchmarking protocol page](http://www.phpbenchmarks.com/en/documentation/benchmarking-protocol). + +## What is this repository? + +It contains PHP benchmark code. + +Switch branch to select version and benchmark you want to see. + +## Benchmarks + +You can find PHP 8.0 benchmarks results on +[benchmarks results page](http://www.phpbenchmarks.com/en/benchmark/php/8.0). + +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` + +* `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 new file mode 100644 index 0000000..eb22e4f --- /dev/null +++ b/composer.json @@ -0,0 +1,10 @@ +{ + "name": "phpbenchmarks/php", + "license": "proprietary", + "type": "project", + "require": { + "php": "8.0.0", + "ext-json": "*", + "phpbenchmarks/benchmark-json-serialization-hello-world": "1.0.0" + } +} diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..06ee540 --- /dev/null +++ b/public/index.php @@ -0,0 +1,13 @@ +