diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index dc1d8963b..000000000
--- a/.gitattributes
+++ /dev/null
@@ -1,27 +0,0 @@
-# Handle line endings automatically for files detected as text and leave all
-# files detected as binary untouched.
-* text=auto
-
-# Files and directories with the attribute export-ignore won’t be added to
-# archive files. See http://git-scm.com/docs/gitattributes for details.
-.gitattributes export-ignore
-.gitignore export-ignore
-/*.neon export-ignore
-/*.neon.dist export-ignore
-/.github export-ignore
-/rector.php export-ignore
-/.php-cs-fixer.dist.php export-ignore
-/.readthedocs.yml export-ignore
-/Makefile export-ignore
-/box.* export-ignore
-/doc/ export-ignore
-/compose.yaml export-ignore
-/docker/ export-ignore
-/flake.* export-ignore
-/extensions/*tests/ export-ignore
-/phpbench.json export-ignore
-/phpunit.xml.dist export-ignore
-/tests/ export-ignore
-/docs/ export-ignore
-/examples/ export-ignore
-/phpstan/ export-ignore
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
deleted file mode 100644
index 34fbbad24..000000000
--- a/.github/FUNDING.yml
+++ /dev/null
@@ -1 +0,0 @@
-github: dantleech
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index a039136f6..000000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "version": 2,
- "updates": [
- {
- "allow": [
- {
- "dependency-type": "all"
- }
- ],
- "directory": "/",
- "package-ecosystem": "composer",
- "schedule": {
- "interval": "daily"
- },
- "versioning-strategy": "widen"
- },
- {
- "directory": "/",
- "package-ecosystem": "github-actions",
- "schedule": {
- "interval": "daily"
- }
- }
- ]
-}
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
deleted file mode 100644
index 5c4cd04af..000000000
--- a/.github/workflows/benchmark.yml
+++ /dev/null
@@ -1,57 +0,0 @@
-name: Benchmark
-
-on:
- push:
- branches:
- # change this to your main branch
- - master
-
-jobs:
- benchmark:
- name: Benchmark
- runs-on: ubuntu-latest
- permissions:
- contents: write
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Install PHP
- uses: shivammathur/setup-php@v2
- with:
- coverage: none
- php-version: "8.2"
- tools: composer:v2
-
- - name: Composer install
- uses: ramsey/composer-install@v2
- with:
- composer-options: "--no-scripts"
-
- # optionally ensure that the gh-pages branch exists. feel free to create
- # this yourself and ommit this step.
- - name: Ensure gh-pages branch exists
- run: |
- if ! git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then
- git config user.name "github-actions[bot]"
- git config user.email "12345678+github-actions[bot]@users.noreply.github.com"
- empty_tree="$(git hash-object -t tree /dev/null)"
- commit="$(git commit-tree "$empty_tree" -m 'Initial gh-pages branch')"
- git push origin "$commit:refs/heads/gh-pages"
- fi
-
- - name: Run PHPBench
- # you probably need to change this to vendor/bin/phpbench
- run: bin/phpbench run --progress=plain --report=github-action-benchmark --output=json > output.json
-
- - name: Store benchmark result
- uses: benchmark-action/github-action-benchmark@v1
- with:
- name: PHPBench Performance
- tool: customSmallerIsBetter
- output-file-path: output.json
- gh-pages-branch: gh-pages
- benchmark-data-dir-path: benchmarks
- auto-push: true
- github-token: ${{ secrets.GITHUB_TOKEN }}
-
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index f1cb890c9..6b125edfe 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -20,12 +20,12 @@ jobs:
strategy:
matrix:
php-version:
- - '8.2'
+ - '7.2'
steps:
-
name: "Checkout code"
- uses: "actions/checkout@v3"
+ uses: "actions/checkout@v2"
-
name: "Install PHP"
@@ -34,47 +34,11 @@ jobs:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: composer:v2
+
-
name: "Validate composer.json"
run: "composer validate --strict --no-check-lock"
- composer-normalize:
- needs:
- - "composer-validate"
-
- name: "Composer Normalize (${{ matrix.php-version }})"
-
- runs-on: "ubuntu-latest"
-
- strategy:
- matrix:
- php-version:
- - '8.2'
-
- steps:
- -
- name: "Checkout code"
- uses: "actions/checkout@v3"
-
- -
- name: "Install PHP"
- uses: "shivammathur/setup-php@v2"
- with:
- coverage: "none"
- extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
- php-version: "${{ matrix.php-version }}"
- tools: composer:v2
-
- -
- name: "Composer install"
- uses: "ramsey/composer-install@v3"
- with:
- composer-options: "--no-scripts"
-
- -
- name: "Run composer normalize"
- run: "composer normalize --dry-run --indent-size=4 --indent-style=space"
-
php-cs-fixer:
needs:
- "composer-validate"
@@ -86,24 +50,25 @@ jobs:
strategy:
matrix:
php-version:
- - '8.2'
+ - '7.2'
steps:
-
name: "Checkout code"
- uses: "actions/checkout@v3"
+ uses: "actions/checkout@v2"
-
name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
+ extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: composer:v2
-
name: "Composer install"
- uses: "ramsey/composer-install@v3"
+ uses: "ramsey/composer-install@v1"
with:
composer-options: "--no-scripts"
@@ -122,12 +87,12 @@ jobs:
strategy:
matrix:
php-version:
- - '8.5'
+ - '7.2'
steps:
-
name: "Checkout code"
- uses: "actions/checkout@v3"
+ uses: "actions/checkout@v2"
-
name: "Install PHP"
@@ -140,7 +105,7 @@ jobs:
-
name: "Composer install"
- uses: "ramsey/composer-install@v3"
+ uses: "ramsey/composer-install@v1"
with:
composer-options: "--no-scripts"
@@ -161,68 +126,59 @@ jobs:
strategy:
matrix:
php-version:
- - '8.2'
- - '8.3'
- - '8.4'
- - '8.5'
+ - '7.2'
+ - '7.3'
+ - '7.4'
dependency:
- 'lowest'
- 'highest'
with-examples: ['yes']
allow-failures: [false]
- composer-options: ['']
include:
- - php-version: '8.2'
- dependency: 'highest'
- with-examples: 'yes'
+ - php-version: '7.2'
+ dependency: 'lowest'
+ with-examples: 'no'
allow-failures: false
- symfony-version: '7.0.*'
- - php-version: '8.5'
+ coverage: xdebug
+ - php-version: '8.0'
dependency: 'highest'
- with-examples: 'yes'
- allow-failures: false
- composer-minimum-stability: 'beta'
- symfony-version: '^8.0.0-BETA1'
+ with-examples: 'no'
+ allow-failures: true
+ coverage: xdebug
steps:
- name: "Checkout code"
- uses: actions/checkout@v3
+ uses: actions/checkout@v2.3.3
- name: "Install PHP with extensions"
- uses: shivammathur/setup-php@2.35.5
+ uses: shivammathur/setup-php@2.7.0
with:
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: ${{ matrix.php-version }}
- tools: composer:v2, flex
+ tools: composer:v2
- name: "Add PHPUnit matcher"
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- - name: Configure Composer minimum-stability
- if: matrix.composer-minimum-stability
- run: composer config minimum-stability ${{ matrix.composer-minimum-stability }}
+ - name: "Remove friendsofphp/php-cs-fixer"
+ run: composer remove --dev friendsofphp/php-cs-fixer --no-update
- name: "Composer install"
- uses: "ramsey/composer-install@v3"
+ uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependency }}"
- composer-options: "${{ matrix.composer-options }}"
- env:
- SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
- name: PHP Info
run: php --version
- name: "Run tests with PHPUnit"
- run: "vendor/bin/phpunit --log-junit phpunit-${{ matrix.php-version }}-${{ matrix.dependency }}.xml"
- env:
- SKIP_XDEBUG_TESTS: "${{ matrix.skip_xdebug_tests }}"
+ run: vendor/bin/phpunit --verbose
- name: "Run benchmarks with PHPBench"
- run: "bin/phpbench run --report=env --progress=plain --dump-file=phpbench-${{ matrix.php-version }}-${{ matrix.dependency }}.xml"
+ run: bin/phpbench run --report=env --progress=dots
- if: matrix.with-examples == 'yes'
- run: bin/phpbench run --profile=examples --report=env --progress=plain --iterations=1 --revs=1
+ run: bin/phpbench run --profile=examples --report=env --progress=dots --iterations=1 --revs=1
- if: matrix.with-examples == 'yes'
run: bin/phpbench run --profile=examples --iterations=1 --revs=1 --report=catordog --executor=acme
diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml
index 86c3ccaeb..0ee6ccb24 100644
--- a/.github/workflows/documentation.yaml
+++ b/.github/workflows/documentation.yaml
@@ -14,12 +14,12 @@ jobs:
steps:
- name: "Checkout code"
- uses: actions/checkout@v3
+ uses: actions/checkout@v2
- - name: "Set up Python 3.9"
- uses: actions/setup-python@v3
+ - name: "Set up Python 3.7"
+ uses: actions/setup-python@v1
with:
- python-version: '3.9' # Semantic version range syntax or exact version of a Python version
+ python-version: '3.7' # Semantic version range syntax or exact version of a Python version
- name: "Display Python version"
run: python -c "import sys; print(sys.version)"
@@ -28,10 +28,10 @@ jobs:
run: sudo apt-get update
- name: "Install Sphinx dependencies"
- run: sudo apt-get install python3-dev build-essential
+ run: sudo apt-get install python-dev build-essential
- name: "Cache pip"
- uses: actions/cache@v4
+ uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('docs/conf.py') }}
@@ -40,7 +40,7 @@ jobs:
- name: "Install Sphinx + requirements via pip"
working-directory: "docs"
- run: pip3 install -r requirements.txt
+ run: pip install -r requirements.txt
- name: "Build documentation"
working-directory: "docs"
@@ -53,7 +53,7 @@ jobs:
steps:
- name: "Checkout code"
- uses: actions/checkout@v3
+ uses: actions/checkout@v2
- name: "Run DOCtor-RST"
uses: docker://oskarstark/doctor-rst
diff --git a/.github/workflows/release-phar.yml b/.github/workflows/release-phar.yml
index bbfb76b96..dd77fc1b4 100644
--- a/.github/workflows/release-phar.yml
+++ b/.github/workflows/release-phar.yml
@@ -8,21 +8,21 @@ name: Append phpbench.phar to release
jobs:
build:
name: Compile and upload Phar
- runs-on: ubuntu-latest
+ runs-on: ubuntu-18.04
steps:
- name: Checkout code
- uses: actions/checkout@v3
+ uses: actions/checkout@v2
with:
fetch-depth: 0
- - name: Set PHP 8.2
+ - name: Set PHP 7.3
uses: shivammathur/setup-php@v2
with:
- php-version: '8.2'
+ php-version: '7.3'
-
name: "Composer install"
- uses: "ramsey/composer-install@v3"
+ uses: "ramsey/composer-install@v1"
with:
composer-options: "--no-scripts --no-dev"
diff --git a/.gitignore b/.gitignore
index c2093f189..3f70e71e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,11 +4,13 @@
/build
/.phpbench.sqlite
/phpunit.xml
+/.travis/phpbench-phar-private.pem
/phpbench.json
-/.php-cs-fixer.cache
+/.travis/build-key.pem
+/.travis/secrets.tar
+/.php_cs.cache
/.phpunit.result.cache
/tests/Workspace
/coverage
/.phpbench
-/.phpunit.cache
/**/*.pyc
diff --git a/.gitignoree b/.gitignoree
new file mode 100644
index 000000000..3f70e71e4
--- /dev/null
+++ b/.gitignoree
@@ -0,0 +1,16 @@
+/composer.lock
+/vendor
+/docs/build
+/build
+/.phpbench.sqlite
+/phpunit.xml
+/.travis/phpbench-phar-private.pem
+/phpbench.json
+/.travis/build-key.pem
+/.travis/secrets.tar
+/.php_cs.cache
+/.phpunit.result.cache
+/tests/Workspace
+/coverage
+/.phpbench
+/**/*.pyc
diff --git a/.php-cs-fixer.dist.php b/.php_cs.dist
similarity index 71%
rename from .php-cs-fixer.dist.php
rename to .php_cs.dist
index abb660b16..2fdf9f2c5 100644
--- a/.php-cs-fixer.dist.php
+++ b/.php_cs.dist
@@ -1,9 +1,6 @@
in([
__DIR__ . '/lib',
__DIR__ . '/tests',
@@ -14,22 +11,19 @@
])
;
-return (new Config())
+return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
- '@PSR12' => true,
- 'void_return' => false,
- 'binary_operator_spaces' => [
- 'operators' => [
- '=>' => null
- ],
- ],
+ '@PSR2' => true,
+ 'void_return' => true,
+ 'binary_operator_spaces' => [ 'align_double_arrow' => false ],
'blank_line_before_statement' => [
'statements' => [
'break',
'continue',
'declare',
'default',
+ 'die',
'do',
'exit',
'for',
@@ -48,15 +42,19 @@
'yield',
],
],
+ 'ordered_imports' => true,
'concat_space' => false,
+ 'method_argument_space' => false,
'no_unused_imports' => true,
+ 'ordered_imports' => true,
'php_unit_set_up_tear_down_visibility' => true,
- 'phpdoc_align' => false,
+ 'phpdoc_align' => [],
'phpdoc_indent' => false,
'phpdoc_separation' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true
],
- 'fully_qualified_strict_types' => false,
+ 'fully_qualified_strict_types' => true,
])
- ->setFinder($finder);
+ ->setFinder($finder)
+ ;
diff --git a/.readthedocs.yml b/.readthedocs.yml
index 79555ed9a..d8a9006af 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -1,14 +1,11 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
-build:
- os: ubuntu-22.04
- tools:
- python: "3.12"
sphinx:
configuration: docs/conf.py
python:
+ version: 3.7
install:
- requirements: docs/requirements.txt
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..6638bf61e
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,33 @@
+language: php
+
+cache:
+ directories:
+ - "$HOME/.composer/cache"
+
+stages:
+ - deploy
+
+jobs:
+ include:
+ - stage: Deploy
+
+ if: (NOT type IN (pull_request)) AND (branch = master)
+
+ php: 7.2
+
+ before_install:
+ - source .travis/xdebug.sh
+ - xdebug-disable
+
+ script: skip
+
+ before_deploy:
+ - ./.travis/before-deploy.sh
+
+ deploy:
+ provider: pages
+ skip-cleanup: true
+ github-token:
+ secure: "cVKcMHHv6MV1HiP78hYPyBx6VIy+DzIv6HS0QM/g3gHnE7EWopu9mQjku2DQtQWAjqVrIPL3ClvZxJH5MjDd4/kB6kWQDGX5O2+CaqzhaJgSpT0htFLbiClqK1uvl2QnHoqwfnhIux230AWDtQfod1g1p60nryo65pLG0HGHqXU="
+ on:
+ branch: master
diff --git a/.travis/before-deploy-gh-release.sh b/.travis/before-deploy-gh-release.sh
new file mode 100755
index 000000000..b399ba952
--- /dev/null
+++ b/.travis/before-deploy-gh-release.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# set -x
+
+export PATH=.:$PATH
+
+# Travis won't deploy ignored files
+sed -ie '/^\/phpbench.phar*/d' .gitignore
+
+# Install PHAR dependencies and remove strip other dev deps.
+rm -Rf ./vendor
+rm -f composer.lock
+composer install --no-dev -o
+
+wget https://github.com/box-project/box/releases/download/3.8.5/box.phar
+php box.phar compile -c box.json.gh-release
+
+echo "Done pre-deploy build"
diff --git a/.travis/before-deploy.sh b/.travis/before-deploy.sh
new file mode 100755
index 000000000..9485a49d2
--- /dev/null
+++ b/.travis/before-deploy.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+# set -x
+
+export PATH=.:$PATH
+
+# Travis won't deploy ignored files
+sed -ie '/^\/phpbench.phar*/d' .gitignore
+
+# Extract the private key (needed to sign the PHAR)
+openssl aes-256-cbc \
+ -K "${encrypted_d58d55177063_key:?'Encrypted key not assigned'}" \
+ -iv "${encrypted_d58d55177063_iv:?'Encrypted iv not assigned'}" \
+ -in .travis/secrets.tar.enc \
+ -out .travis/secrets.tar \
+ -d
+tar xvf .travis/secrets.tar -C .travis
+
+# Install PHAR dependencies and remove strip other dev deps.
+rm -Rf ./vendor
+rm -f composer.lock
+composer require "doctrine/dbal" "~2.5" --no-update
+composer require "padraic/phar-updater" "^1.0" --no-update
+composer install --no-dev -o
+
+# Build the PHAR
+curl -LSs https://box-project.github.io/box2/installer.php | php
+box.phar build
+ls
+
+# Dump the version file (used to see if PHPBench needs an update)
+sha1sum phpbench.phar > phpbench.phar.version
+echo "Done pre-deploy build"
diff --git a/.travis/secrets.tar.enc b/.travis/secrets.tar.enc
new file mode 100644
index 000000000..b3641d585
Binary files /dev/null and b/.travis/secrets.tar.enc differ
diff --git a/.travis/xdebug.sh b/.travis/xdebug.sh
new file mode 100644
index 000000000..1914365bb
--- /dev/null
+++ b/.travis/xdebug.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+
+# The problem is that we do not want to remove the configuration file, just disable it for a few tasks, then enable it
+#
+# For reference, see
+#
+# - https://docs.travis-ci.com/user/languages/php#Disabling-preinstalled-PHP-extensions
+# - https://docs.travis-ci.com/user/languages/php#Custom-PHP-configuration
+
+config="/home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini"
+
+function xdebug-disable() {
+ if [[ -f $config ]]; then
+ mv "$config" "$config.bak"
+ fi
+}
+
+function xdebug-enable() {
+ if [[ -f "$config.bak" ]]; then
+ mv "$config.bak" "$config"
+ fi
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 38502247d..9aebfb148 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,361 +1,11 @@
CHANGELOG
=========
-master
-------
-
-- Conditionally show the baseline "difference" in the default expression
- report. #1154 @dantleech
-
-1.7.0
------
-
-- reports: new `derivations` feature to allow computing values from existing values. @dantleech
-- reports: deprecate `baseline_expressions` as the same can now be
- accomplished with `derivations`. @dantleech
-- reports: `aggregate-preview` report (includes r diff column): will become the new `aggregate` in PHPBench 2.0 @dantleech
-- expr: lazy function evaluation on select functions (just the `if()` function
- for now). @dantleech
-- expr: allow the nullsafe operator on bare variables
-- meta: Exclude docs and other non-code assets in `.gitattributes` @sasezaki
-- meta: Bump phpstan to 2.x @dantleech
-
-1.6.1
------
-
-- Handle undefined offset error for unsupproted time formats
-- Allow NULL to be passed as a time unit (will use the base unit)
-
-1.6.0
------
-
-- reports: JSON progress logging #1018
-- reports: JSON report renderering #1135
-- expression-language: `if(cond,val1,val2)` as a conditional expression
-- expression-language: `!=` unequals operator
-- expression-language: `time_unit` function to normalize a timeunit
-- expression-language: `time_convert` function to convert time
-
-1.5.0
------
-
-- Add support for PHP 8.5
-- Handle infinity percentage #1134 @ajezz
-- Symfony 8 Support #1125 @kocal
-
-1.4.0
------
-
-- Add support for 8.4 (explicit nullables)
-- Bring the `phpbench/dom` library into this repository.
-- Introduce `.gitattributes` to not publish tests files etc.
-
-1.3.1
------
-
-- Fix schema concat issue in PHAR
-
-1.3.0
------
-
-Features:
-
-- Add default `table_summary` report component @dantleech
-- Add command to initialize the configuration file (`config:init`) @dantleech
-- Add command to add a new service config based on a prototype (`config:extend`) @dantleech
-
-Improvements:
-
-- Use single quotes for expressions in the default reports @dantleech
-- Hide noisy log messages for missing fields #1095 @dantleech
-- Improved types etc @aivchen #1064 #1064 #1070 #1071 #1074 #1081...
-- Improved tests @aivchen
-- Improved code-style @aivchen #1057 #1076 #1070
-- Import Attribute symbol @gsteel #1075
-
-Bug fixes:
-
-- Ignore `@template` and other generic annotations #1097 @dantleech
-- Defer character reader until command execution @jbboher #1092
-
-1.2.15
-------
-
-- Bump minimum PHP version to 8.1
-- Allow Symfony 7.0 @keulinho
-- Add documentation for adding env providers @GromNaN
-
-1.2.{11,12,13,14} (09/07/2023)
-------------------------------
-
-Improvements:
-
-- Use latest version of Box
-- Fixing build
-
-1.2.10 (24/04/2023)
--------------------
-
-Improvements:
-
-- Fix deprecation warning when using blinken logger @tavaresmatheus
-
-1.2.9
------
-
-Bug fixes:
-
-- Fix PHP 8.2 deprecation warning #1022
-
-Improvements:
-
-- Drop support for 7.3 and support for 8.1 and 8.2 in the pipeline.
-
-1.2.8
------
-
-Improvements:
-
-- Update documentation to point to reference new GPG key #1017
-- Support Doctrine Annotations 2.0 #1013 @greg0ire
-- Profiler: detect Xdebug `.gz` files when compression enabled #1011 @blackwolf12333
-
-1.2.7
------
-
-Improvements:
-
-- Remove dependency on `webmozart/path` (copied the class into PHPBench)
-- Update PHPStan to 1.0 and fix new errors #1006
-- Use `webmozart/glob` instead of `glob` for benchmark paths and config
- include paths #1005
-
-Bug fixes:
-
-- Fix bad exception call #1002 @TRowbotham
-- Fix comma formatting of numbers with no zero decimal precision #1008
-
-1.2.6
------
-
-Bug fixes:
-
-- Allow multiple `Assert` annotations #996 @nyamsprod
-
-1.2.5
------
-
-Bug fixes:
-
-- New "CouldNotLoadMetadata" exception was located in the `tests` folder and
- was not available when phpbench was used as a dependency.
-
-1.2.4
------
-
-Improvements
-
-- Show [solidarity](https://github.com/vshymanskyy/StandWithUkraine) with Ukrainians
-- Show more concise error messages including script exit code #969
-- Configuration (`expression.strip_tailing_zeros`) to strip meaningless zeros after the decimal place #958
-
-1.2.3
-------
-
-Improvements:
-
-- Allow `psr/log` `2.x` and `3.x`
-
-Bug fixes:
-
-- Parameters seem to be converted to strings when storing/retrieving #959
-
-1.2.2
------
-
-Bug fixes:
-
-- Fix non-existing mappings in composer file #955 @Dgame
-
-1.2.1
------
-
-Bug fixes:
-
-- Do not index variants by parameter set name (as they vary by number of
- revs/iterations etc also) #947
-
-Improvements:
-
-- Symfony 6 support - @julien-boudry
-- Allow globs in benchmark path specification - @ricardoboss
-
-1.2.0
------
-
-Features:
-
-- [expression] Support binary memory units #934
-- [reporting] Ability to expand table columns dynamically #928
-- [reporting] Ability to group columns #928
-- [reporting] Added `benchmark_compare` default report #928
-- [cli] Ability to filter by variant #938
-- [cli] Ability to filter reports #940
-
-Improvements:
-
-- [storage] Allow `.` in tag names
-- [runner] Do not show warning when unable to load metadata for benchmark IF
- the `runner.file_pattern` is specified #941
-
-Bug fixes:
-
-- Fix property (`.`) access precedence, it is now the same as `[` array
- access #928
-
-1.1.3 (2021-10-31)
-------------------
-
-- Fix bug with misassigned labels in bar chart #931
-- Safely removed non-functioning config option `report.html_output_dir` #930
-
-1.1.2 (2021-09-25)
-------------------
-
-- Removing PHP8.1 deprecations - @Crell
-- Removing PHP7.2 support
-
-1.1.1 (2021-09-08)
-------------------
-
-Bug fixes:
-
-- Prevent registering #[ParamProviders(...)] multiple times when benchmark methods are inherited #918 - @ocramius
-
-1.1.0 (2021-08-15)
-------------------
-
-Bug fixes:
-
-- Ensure all refs are passed to report in run mode #864
-- Memory formatting respects precision directive #892
-- Remove double title output when description used in console reports #848
-
-Features:
-
-- Allow env vars to be passed to the benchmark process.
-- Allow config files to include other config files via. `$include` and
- `$include-glob` #989
-- Added `contains` function to see if a value exists in a list.
-- Added `frame` function to create a new data frame within an expression.
-- Added `sum` and `count` functions #865
-- New component based report generator #851
-- HTML Bar Chart component #853
-- Console Bar Chart component #858
-- Data Frame and Expression Filtering #831
-- Allow multiple benchmark paths to be specified from CLI #834
-- Functions which require at least one value return NULL when values are
- empty #835
-- Add `--limit` option to `log` command #879
-- Add `bare-vertical` report configuration (same as `--report='extends: bare,{"vertical": true}`) #879
-
-Improvement:
-
-- Surpress reports if errors were encountered during the run #912
-- Support expressions in parttion specifications
-- Data can be accessed on any expression value (not just "parameters")
-- Use automatic time unit for expression report #838
-- Parameter handling refactored to be "safe": objects will not be unserialized
- in the PHPBench process #845
-- Allow single quoted strings in expressions (better with JSON) #895
-
-Other changes:
-
-- "0" is not longer shown as the "set name" in reports, it is now an empty
- string.
-- Lists and data frames can no longer be compared. Use the `frame` function to
- convert a list to a data frame (in the unlikely event you compare a list
- with a frame in a report).
-
-1.0.4 (2021-07-18)
-------------------
-
-Bug fix:
-
-- `runner.executor` setting is ineffective and related bugs #880
-
-1.0.3 (2021-07-03)
-------------------
-
-Bug fix:
-
-- Show warning if file is parsed but it is not a benchmark file. #883
-
- Files that are not suffixed with `Bench.php` are are reflected and their
- docblocks are parsed. Causing unexpected errors if unknown docblock tags are
- present.
-
- As changing this behavior (introduced by error in 2016) is a B/C break,
- it will not be changed in a bug-fix release.
-
- An option `runner.file_pattern` has been added however to enable the
- warnings to be resolved.
-
-Improvement:
-
-- Show warning if metadata could not be loaded for benchmark instead of
- an exception.
-
-1.0.2 (2021-05-28)
-------------------
-
-Bug fix:
-
-- Fix incorrect benchmark column definition in report #840
-- Fix `--ansi` flag not be propagated to report output #844
-
-1.0.1 (2021-05-11)
-------------------
-
-Bug fix:
-
-- Error with bare report when DateTime used as param #832
-
-1.0.0 (2021-05-09)
-------------------
-
-Improvements:
-
-- Optionaly support for binary data in param providers #532
-- Support serializable objects in param providers #823
-
-Bug fix:
-
-- Fix regression which requires phpbench to be installed with composer 2 #822
-
-1.0.0-beta2
------------
-
-B/C breaks:
-
-- Progress logger: startSuite now additionally accepts `RunnerConfig`
-
-Improvements:
-
-- Use package versions to show PHPBench version if not PHAR
-
-Bug fixes:
-
-- Unterminated XML reference #818 - @staabm
-- Parent directory for custom script path not created #739 - @alexandrajulius
-- Windows newline is not understood in expression language #817 - @dantleech
-
1.0.0-beta1
-----------
B/C breaks:
-- Removed `self-update` functionality (suggest using `phive` instead(.
- Most configuration option names have changed. All options are now prefixed
by their extension name, e.g. `bootstrap` => `runner.bootstrap`, `path` =>
`runner.path`, `extensions` => `core.extensions`. See the configuration
diff --git a/README.md b/README.md
index 0b502b8e7..e31beebc8 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,7 @@
-[](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)
-
-[](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)
[](https://github.com/phpbench/phpbench/actions/workflows/ci.yaml)
[](https://github.com/phpbench/phpbench/actions/workflows/documentation.yaml)
[](//packagist.org/packages/phpbench/phpbench)
@@ -22,9 +19,9 @@ Features include:
- [Iterations](https://phpbench.readthedocs.io/en/latest/annotributes.html#iterations): Sample your revolutions many times and review aggregated
statistical data.
- **Process Isolation**: Each iteration is executed in a separate process.
-- [Reporting](https://phpbench.readthedocs.io/en/latest/guides/reports.html): Customizable reports and various output formats (e.g.
+- [Reporting](https://phpbench.readthedocs.io/en/latest/reports.html): Customizable reports and various output formats (e.g.
console, CSV, Markdown, HTML).
-- Report [storage](https://phpbench.readthedocs.io/en/latest/guides/storage.html) and [comparison](https://phpbench.readthedocs.io/en/latest/guides/regression-testing.html): Store benchmarks locally to be used as a
+- Report [storage](https://phpbench.readthedocs.io/en/latest/storage.html) and [comparison](https://phpbench.readthedocs.io/en/latest/regression-testing.html): Store benchmarks locally to be used as a
baseline reference, or to reference them later.
- **Memory Usage**: Keep an eye on the amount of memory used by benchmarking
subjects.
@@ -38,20 +35,20 @@ Installation
------------
```bash
-composer require phpbench/phpbench --dev
+$ composer require phpbench/phpbench --dev
```
-See the [installation instructions](http://phpbench.readthedocs.io/en/latest/installing.html) for more options.
+See the [installation instructions](http://phpbench.readthedocs.org/en/latest/installing.html) for more options.
Documentation
-------------
-Documentation is hosted on [readthedocs](http://phpbench.readthedocs.io).
+Documentation is hosted on [readthedocs](http://phpbench.readthedocs.org).
Community
---------
-- Follow [@phpbench](https://phpc.social/@phpbench) on Mastodon for the latest news.
+- Follow [@phpbench](https://twitter.com/phpbench) for the latest news.
- Join the `#phpbench` channel on the Slack [Symfony
Devs](https://symfony-devs.slack.com/join/shared_invite/enQtMzM3NDA1NzEyMzg0LTgyNGYwYjFjMjY5YjllYWZkYTY2OWM4MDQzZTgzMmNjNGI3ZDJhYzE2Yjc4NmFmM2JiOTZjODg2MGJlM2RjMDU)
channel.
@@ -59,25 +56,17 @@ Community
Screenshots
-----------
-Running benchmarks and comparing against a baseline:
-
-
-
-Aggregated report:
+Default output:
-
+
Blinken logger:

-HTML Bar Chart:
-
-
-
-Console Bar Chart:
+HTML report:
-
+
Contributing
------------
diff --git a/benchmarks/data.js b/benchmarks/data.js
new file mode 100644
index 000000000..226a93cb3
--- /dev/null
+++ b/benchmarks/data.js
@@ -0,0 +1,2783 @@
+window.BENCHMARK_DATA = {
+ "lastUpdate": 1781461709784,
+ "repoUrl": "https://github.com/phpbench/phpbench",
+ "entries": {
+ "PHPBench Performance": [
+ {
+ "commit": {
+ "author": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "distinct": true,
+ "id": "9c7d0df43ea9b2470dc5ab611d873f1f08143ad8",
+ "message": "Add github_action_benchmark example",
+ "timestamp": "2026-03-22T09:34:36Z",
+ "tree_id": "0d5772728eca9e9c9afbec02df997e614c85600c",
+ "url": "https://github.com/phpbench/phpbench/commit/9c7d0df43ea9b2470dc5ab611d873f1f08143ad8"
+ },
+ "date": 1774172132136,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7158.283953033134,
+ "range": "± 0.54%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 349.44814090019827,
+ "range": "± 2.60%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 351.61056751467675,
+ "range": "± 1.63%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 344.8258317025461,
+ "range": "± 2.00%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2306.095890410927,
+ "range": "± 1.04%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3404.856164383513,
+ "range": "± 0.54%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5987.96771037176,
+ "range": "± 0.52%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3769.622309197615,
+ "range": "± 1.73%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5487.527397260266,
+ "range": "± 0.65%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 9110.702544031297,
+ "range": "± 0.66%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5208.548923679033,
+ "range": "± 1.18%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7419.43150684933,
+ "range": "± 0.74%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12284.570450097734,
+ "range": "± 0.53%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2847.572015655607,
+ "range": "± 0.99%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 231.84598825831446,
+ "range": "± 1.89%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1076.987866927585,
+ "range": "± 0.41%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 125604.79452054865,
+ "range": "± 0.93%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 127389.30724070617,
+ "range": "± 1.33%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 23868.007827788413,
+ "range": "± 1.15%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 73.73953033267993,
+ "range": "± 1.59%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 66.2232876712336,
+ "range": "± 1.31%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 966.1318982387519,
+ "range": "± 1.64%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1455.03992172212,
+ "range": "± 0.59%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "dan.t.leech@gmail.com",
+ "name": "dantleech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "noreply@github.com",
+ "name": "GitHub",
+ "username": "web-flow"
+ },
+ "distinct": true,
+ "id": "4ad451b76965635a7b76037b05d26243d5a98a8d",
+ "message": "Introduce CI integration guide (#1144)\n\n- Introduce CI integration guide\n- Downgrade sphinx tabs to previous release for github actions\n- Disable yaml/yml doctor rule\n- Do not generate unused references that cause warnings\n- Disable doctor indentation",
+ "timestamp": "2026-03-22T10:14:45Z",
+ "tree_id": "282613905a3e1970594bf627c5caa4cb3539fd44",
+ "url": "https://github.com/phpbench/phpbench/commit/4ad451b76965635a7b76037b05d26243d5a98a8d"
+ },
+ "date": 1774174530790,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7192.658904109632,
+ "range": "± 1.93%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 357.53816046966404,
+ "range": "± 2.47%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 362.0684931506786,
+ "range": "± 1.92%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 347.257338551859,
+ "range": "± 2.09%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2310.6722113502997,
+ "range": "± 0.72%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3462.3003913894277,
+ "range": "± 1.58%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 6103.252446183913,
+ "range": "± 1.58%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3808.4442270057916,
+ "range": "± 0.96%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5573.945205479395,
+ "range": "± 1.50%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 9321.35714285713,
+ "range": "± 1.64%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5206.349315068498,
+ "range": "± 2.72%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7627.772994129211,
+ "range": "± 2.58%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12688.664383561658,
+ "range": "± 2.04%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2860.0634050880753,
+ "range": "± 0.98%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 232.10254403131486,
+ "range": "± 1.54%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1084.4947162426952,
+ "range": "± 0.75%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 130539.19178082186,
+ "range": "± 1.71%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 133803.92759295352,
+ "range": "± 1.43%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 24439.017612524505,
+ "range": "± 1.44%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 75.44931506849416,
+ "range": "± 2.28%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 67.55205479452147,
+ "range": "± 2.28%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 965.8821917808274,
+ "range": "± 1.15%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1479.041487279855,
+ "range": "± 1.22%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "distinct": true,
+ "id": "661c8c6abbc7734986cf7bc6062c237fbb450461",
+ "message": "Do not specify base time unit in example",
+ "timestamp": "2026-03-22T10:27:20Z",
+ "tree_id": "41a3835e9148847946db182411ea82a5df818734",
+ "url": "https://github.com/phpbench/phpbench/commit/661c8c6abbc7734986cf7bc6062c237fbb450461"
+ },
+ "date": 1774175298224,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7086.557338551834,
+ "range": "± 1.22%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 341.990215264193,
+ "range": "± 1.91%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 345.84442270058685,
+ "range": "± 2.04%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 351.6741682974498,
+ "range": "± 1.46%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2239.3796477495507,
+ "range": "± 0.73%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3368.5185909980773,
+ "range": "± 1.01%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5885.640900195718,
+ "range": "± 1.53%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3706.8336594912166,
+ "range": "± 0.61%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5397.406066536216,
+ "range": "± 1.16%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 9109.107632093934,
+ "range": "± 0.60%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5133.2358121330035,
+ "range": "± 0.76%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7282.2788649706745,
+ "range": "± 0.50%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12137.170254403078,
+ "range": "± 0.63%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2827.901565557676,
+ "range": "± 1.41%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 229.89393346379677,
+ "range": "± 2.14%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1080.8726027397702,
+ "range": "± 0.71%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 124873.2465753432,
+ "range": "± 0.97%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 125114.44618395373,
+ "range": "± 0.51%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 23625.04500978518,
+ "range": "± 0.97%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 74.81624266144706,
+ "range": "± 1.93%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 64.44579256360048,
+ "range": "± 1.96%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 964.3516634050874,
+ "range": "± 0.79%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1444.0195694716308,
+ "range": "± 0.65%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "distinct": true,
+ "id": "eb7bd89a56463c4b1086f33fb3e79fc8b636e0a2",
+ "message": "Fix typos",
+ "timestamp": "2026-03-22T10:36:26Z",
+ "tree_id": "647886b2a4ff278f206d2d63b26fa863faec6c7d",
+ "url": "https://github.com/phpbench/phpbench/commit/eb7bd89a56463c4b1086f33fb3e79fc8b636e0a2"
+ },
+ "date": 1774175832869,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7316.974755381556,
+ "range": "± 1.33%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 366.5753424657578,
+ "range": "± 1.78%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 364.61839530333236,
+ "range": "± 2.47%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 373.83855185910966,
+ "range": "± 1.73%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2450.965753424697,
+ "range": "± 1.17%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3580.6604696673503,
+ "range": "± 0.89%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 6197.206457925749,
+ "range": "± 0.57%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3982.0166340509204,
+ "range": "± 0.86%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5849.289628180066,
+ "range": "± 0.99%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 9632.452054794143,
+ "range": "± 1.04%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5585.08904109585,
+ "range": "± 0.81%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7945.510763209411,
+ "range": "± 2.09%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12888.684931507014,
+ "range": "± 0.94%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2898.7013698630444,
+ "range": "± 0.63%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 231.8643835616479,
+ "range": "± 1.33%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1079.3101761252663,
+ "range": "± 0.44%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 135847.44618395457,
+ "range": "± 1.07%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 138728.87475538187,
+ "range": "± 1.03%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 24623.037181996013,
+ "range": "± 0.71%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 76.45753424657572,
+ "range": "± 2.20%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 67.45557729941221,
+ "range": "± 2.14%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 968.1851272015697,
+ "range": "± 1.31%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1454.7714285714237,
+ "range": "± 1.06%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "distinct": true,
+ "id": "8888764ea1ef66db2dbb839d80a90a080bd8dec9",
+ "message": "Update doc",
+ "timestamp": "2026-03-22T17:50:31Z",
+ "tree_id": "bda621a607fe36aaa38aa91eb8331aec8737fd05",
+ "url": "https://github.com/phpbench/phpbench/commit/8888764ea1ef66db2dbb839d80a90a080bd8dec9"
+ },
+ "date": 1774201875598,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7166.860469667357,
+ "range": "± 0.49%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 354.5577299412971,
+ "range": "± 2.30%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 357.68786692760375,
+ "range": "± 2.63%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 353.8806262230935,
+ "range": "± 1.71%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2278.3091976516844,
+ "range": "± 1.04%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3426.364970645808,
+ "range": "± 0.74%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5962.691780821944,
+ "range": "± 1.14%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3742.907045009788,
+ "range": "± 1.61%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5462.381604696659,
+ "range": "± 1.26%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 9171.136007827707,
+ "range": "± 0.86%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5281.357142857076,
+ "range": "± 1.29%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7593.484344422677,
+ "range": "± 1.36%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12291.681017612651,
+ "range": "± 0.92%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2825.335616438337,
+ "range": "± 1.16%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 231.3939334637943,
+ "range": "± 1.59%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1082.1700587084015,
+ "range": "± 1.54%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 128940.20939334795,
+ "range": "± 1.22%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 127703.86692759267,
+ "range": "± 0.94%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 24089.812133072322,
+ "range": "± 1.20%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 74.62328767123341,
+ "range": "± 1.61%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 66.93502935420658,
+ "range": "± 1.34%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 975.1786692759104,
+ "range": "± 1.26%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1452.8473581213111,
+ "range": "± 0.32%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "distinct": true,
+ "id": "e1fcce2f8072842fa9a814490378bea3bba29c42",
+ "message": "docs: Add an example on adding a diff column",
+ "timestamp": "2026-04-04T15:54:05+01:00",
+ "tree_id": "900c9edce7ab8970dab24d2e318f99b1dff63031",
+ "url": "https://github.com/phpbench/phpbench/commit/e1fcce2f8072842fa9a814490378bea3bba29c42"
+ },
+ "date": 1775314483281,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 1836.7064579256387,
+ "range": "± 0.93%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 283.7681017612474,
+ "range": "± 1.23%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 274.8356164383572,
+ "range": "± 1.99%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 280.9129158512716,
+ "range": "± 2.12%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2287.3727984343714,
+ "range": "± 2.16%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3191.993150685009,
+ "range": "± 0.96%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5163.3698630136605,
+ "range": "± 0.81%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3668.3287671232865,
+ "range": "± 1.05%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5316.0205479451115,
+ "range": "± 1.03%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 8242.037181996115,
+ "range": "± 1.93%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5148.286692759224,
+ "range": "± 1.79%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7184.0763209392735,
+ "range": "± 0.84%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 11063.824853229027,
+ "range": "± 0.98%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 6176.8133072406645,
+ "range": "± 0.55%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 208.22465753424706,
+ "range": "± 2.24%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 901.1853228962809,
+ "range": "± 0.92%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 57.84579256360099,
+ "range": "± 1.71%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 51.41448140900244,
+ "range": "± 1.34%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1186.0410958904115,
+ "range": "± 0.76%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 802.0776908023386,
+ "range": "± 0.68%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 96894.75342465745,
+ "range": "± 0.63%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 96063.6712328768,
+ "range": "± 1.42%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 19844.318982387646,
+ "range": "± 0.66%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "sasezaki+github@gmail.com",
+ "name": "sasezaki",
+ "username": "sasezaki"
+ },
+ "committer": {
+ "email": "noreply@github.com",
+ "name": "GitHub",
+ "username": "web-flow"
+ },
+ "distinct": true,
+ "id": "2f2742b3bfd1416ca95d4e0338af0b6897cf4e64",
+ "message": "Add export-ignore rules to .gitattributes (#1146)\n\n* Add missing export-ignore entries to .gitattributes\n\n* Remove /templates/ from export-ignore (used at runtime)",
+ "timestamp": "2026-05-06T21:19:39+02:00",
+ "tree_id": "90e9703a359be4f7f3a3eed18625b9d2f74141a7",
+ "url": "https://github.com/phpbench/phpbench/commit/2f2742b3bfd1416ca95d4e0338af0b6897cf4e64"
+ },
+ "date": 1778095229677,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 123466.39726027445,
+ "range": "± 2.11%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 129975.26223092062,
+ "range": "± 0.89%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 23456.637964774956,
+ "range": "± 0.54%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 76.20528375733652,
+ "range": "± 1.49%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 67.16986301369793,
+ "range": "± 2.01%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1425.938943248517,
+ "range": "± 0.94%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 255.6381604696698,
+ "range": "± 2.03%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1116.0493150684913,
+ "range": "± 0.73%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 948.267123287678,
+ "range": "± 1.09%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 328.1203522504871,
+ "range": "± 2.06%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 338.3718199608729,
+ "range": "± 1.89%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 321.2866927592946,
+ "range": "± 2.31%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2099.145792563613,
+ "range": "± 1.56%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3248.0802348336438,
+ "range": "± 1.74%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5742.154598825837,
+ "range": "± 1.26%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3635.9706457925577,
+ "range": "± 1.15%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5377.595890410945,
+ "range": "± 1.05%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 8978.643835616502,
+ "range": "± 1.15%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5221.660469667289,
+ "range": "± 1.57%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7835.084148728145,
+ "range": "± 1.94%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12972.475538160425,
+ "range": "± 1.54%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7609.2434442269805,
+ "range": "± 2.48%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2433.768493150627,
+ "range": "± 0.62%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "dan.t.leech@gmail.com",
+ "name": "dantleech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "noreply@github.com",
+ "name": "GitHub",
+ "username": "web-flow"
+ },
+ "distinct": true,
+ "id": "07b4fa73a8c706cd1bd98755ddadace3dba8248e",
+ "message": "Allow lazy evaluation for functions (#1149)",
+ "timestamp": "2026-06-06T16:19:12+01:00",
+ "tree_id": "3f25ac29991acaa8f0a82c7b8cd7591f01646b3e",
+ "url": "https://github.com/phpbench/phpbench/commit/07b4fa73a8c706cd1bd98755ddadace3dba8248e"
+ },
+ "date": 1780759190068,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1416.9023483366045,
+ "range": "± 1.81%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 72.08219178082234,
+ "range": "± 1.95%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 65.72348336595009,
+ "range": "± 1.85%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 941.4217221135034,
+ "range": "± 0.82%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7158.73091976512,
+ "range": "± 0.83%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 331.8483365949212,
+ "range": "± 2.33%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 328.06164383561463,
+ "range": "± 2.43%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 335.5909980430631,
+ "range": "± 2.62%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2057.090998043055,
+ "range": "± 1.31%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3168.2446183952707,
+ "range": "± 1.21%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5547.847358121311,
+ "range": "± 0.74%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3537.7045009784724,
+ "range": "± 0.77%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5273.9148727984575,
+ "range": "± 1.58%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 8792.689823874749,
+ "range": "± 1.24%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5077.126223091975,
+ "range": "± 0.81%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7398.478473581083,
+ "range": "± 1.15%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12183.647749510621,
+ "range": "± 0.90%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2421.8430528375557,
+ "range": "± 0.82%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 121694.49902152584,
+ "range": "± 0.67%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 122228.15068493379,
+ "range": "± 0.67%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 22825.320939334848,
+ "range": "± 0.43%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 244.27964774951,
+ "range": "± 1.56%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1131.1430528375774,
+ "range": "± 0.74%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "dan.t.leech@gmail.com",
+ "name": "dantleech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "noreply@github.com",
+ "name": "GitHub",
+ "username": "web-flow"
+ },
+ "distinct": true,
+ "id": "fbab09e522838babcdca79085ff769f3bc734e77",
+ "message": "Various fixes and improvements (#1150)\n\n- expr: Boolean node is a scalar value\n- expr: Support the nullsafe operator on bare variables\n- expr: Allow display as \"rstdev\"\n- tests: approval support for empty files",
+ "timestamp": "2026-06-07T09:50:04+01:00",
+ "tree_id": "7a7664abd6ad642bf61a1b20a3b78b3cbf767fc4",
+ "url": "https://github.com/phpbench/phpbench/commit/fbab09e522838babcdca79085ff769f3bc734e77"
+ },
+ "date": 1780822248804,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1400.4219178082242,
+ "range": "± 1.10%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 75.25577299412814,
+ "range": "± 1.73%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 66.98669275929421,
+ "range": "± 1.89%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 946.1559686888431,
+ "range": "± 1.09%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7236.970254403114,
+ "range": "± 0.93%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 330.1722113502974,
+ "range": "± 2.56%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 332.7534246575341,
+ "range": "± 2.13%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 336.2084148727947,
+ "range": "± 1.76%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2120.821917808248,
+ "range": "± 1.27%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3215.8336594911925,
+ "range": "± 1.36%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5640.761252446135,
+ "range": "± 0.97%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3723.438356164459,
+ "range": "± 0.83%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5545.917808219199,
+ "range": "± 2.44%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 8996.177103718226,
+ "range": "± 2.55%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5213.321917808213,
+ "range": "± 1.05%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7815.63405088059,
+ "range": "± 1.73%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12709.438356164253,
+ "range": "± 1.19%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2435.761839530371,
+ "range": "± 1.22%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 130963.65362035147,
+ "range": "± 1.14%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 131874.44031311368,
+ "range": "± 0.38%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 23659.045009784062,
+ "range": "± 1.16%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 246.85714285714198,
+ "range": "± 2.03%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1133.304500978464,
+ "range": "± 1.24%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "dan.t.leech@gmail.com",
+ "name": "dantleech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "noreply@github.com",
+ "name": "GitHub",
+ "username": "web-flow"
+ },
+ "distinct": true,
+ "id": "5c72bb108eac249dd427953a90b5583e2e2c1a7f",
+ "message": "Bump phpstan (#1151)\n\n* Bump PHPStan and related deps and fix some issues\n\n- PHPstan to 2.x and related packages.\n- Fix some of the newly reported issues.\n- Update baseline.\n\n* Support console 6.x",
+ "timestamp": "2026-06-07T10:33:04+01:00",
+ "tree_id": "4babbe93ec5a9c37a42b152f2c1db1c6d3e09735",
+ "url": "https://github.com/phpbench/phpbench/commit/5c72bb108eac249dd427953a90b5583e2e2c1a7f"
+ },
+ "date": 1780824824564,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1406.174951076309,
+ "range": "± 1.34%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 73.41878669276029,
+ "range": "± 2.36%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 66.3851272015662,
+ "range": "± 1.73%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 943.0669275929661,
+ "range": "± 1.17%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7132.07318982385,
+ "range": "± 0.67%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 322.77103718199277,
+ "range": "± 1.29%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 317.4960861056768,
+ "range": "± 2.72%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 319.386497064581,
+ "range": "± 2.58%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2215.484344422657,
+ "range": "± 1.09%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3335.157534246556,
+ "range": "± 1.31%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5718.952054794527,
+ "range": "± 1.03%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3593.8718199608784,
+ "range": "± 1.40%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5327.438356164275,
+ "range": "± 0.95%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 8777.323874755482,
+ "range": "± 1.15%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5126.949119373784,
+ "range": "± 1.34%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7456.952054794601,
+ "range": "± 0.92%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12194.98043052843,
+ "range": "± 1.50%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2416.442465753444,
+ "range": "± 1.01%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 122695.4637964773,
+ "range": "± 1.53%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 122638.30136986238,
+ "range": "± 1.18%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 22917.027397260368,
+ "range": "± 0.43%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 246.64814090019433,
+ "range": "± 1.04%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1134.6976516634238,
+ "range": "± 1.52%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "distinct": true,
+ "id": "e8145c81d2ffffb249a2f9f6c6adec2ef1efc3f5",
+ "message": "Delete dead snapshots",
+ "timestamp": "2026-06-07T10:44:43+01:00",
+ "tree_id": "fd326cb5ee7584559bea1407edd718400f91fefd",
+ "url": "https://github.com/phpbench/phpbench/commit/e8145c81d2ffffb249a2f9f6c6adec2ef1efc3f5"
+ },
+ "date": 1780825528048,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1435.581017612527,
+ "range": "± 1.18%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 72.16144814090075,
+ "range": "± 2.41%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 64.4724070450097,
+ "range": "± 2.38%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 948.3616438356134,
+ "range": "± 1.06%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7122.40567514674,
+ "range": "± 0.78%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 346.5185909980426,
+ "range": "± 2.07%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 347.25048923679014,
+ "range": "± 1.87%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 348.36888454011694,
+ "range": "± 1.91%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2256.8590998043114,
+ "range": "± 1.83%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3348.450097847347,
+ "range": "± 0.89%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5898.365949119416,
+ "range": "± 0.63%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3589.573385518604,
+ "range": "± 0.92%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5266.256360078254,
+ "range": "± 1.07%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 9009.331702543925,
+ "range": "± 1.43%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5102.496086105664,
+ "range": "± 0.85%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7340.281800391405,
+ "range": "± 0.77%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12174.765166340621,
+ "range": "± 0.58%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2720.491585127196,
+ "range": "± 0.79%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 116233.97847358105,
+ "range": "± 0.63%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 116452.16438356153,
+ "range": "± 0.62%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 23353.090019569034,
+ "range": "± 0.68%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 235.57045009784497,
+ "range": "± 1.32%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1167.7178082191683,
+ "range": "± 0.42%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "dan.t.leech@gmail.com",
+ "name": "dantleech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "noreply@github.com",
+ "name": "GitHub",
+ "username": "web-flow"
+ },
+ "distinct": true,
+ "id": "4da0b8279e54f93d760fa078b5f0103c43c555b8",
+ "message": "Report Derivations (#1148)\n\n- Derive columns from existing columns.\n- One or multiple passes.\n- New \"aggregate-preview\" report which includes the new \"diff\" column\n making use of this feature.\n- Add documentation\n- Deprecates the `BASELINE_EXPRESSIONS` option\n- nl2br in HTML report for description",
+ "timestamp": "2026-06-07T11:40:05+01:00",
+ "tree_id": "77ea4b88bd97ae1d9578a0e039cac39335914c2e",
+ "url": "https://github.com/phpbench/phpbench/commit/4da0b8279e54f93d760fa078b5f0103c43c555b8"
+ },
+ "date": 1780828845857,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1437.781409001963,
+ "range": "± 1.22%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 76.02446183952868,
+ "range": "± 2.04%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 67.78317025440306,
+ "range": "± 2.18%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 948.5890410958818,
+ "range": "± 0.67%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7340.223874755323,
+ "range": "± 1.73%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 324.82876712328743,
+ "range": "± 2.81%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 335.0577299413002,
+ "range": "± 2.27%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 335.59491193737983,
+ "range": "± 2.24%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2341.7690802348034,
+ "range": "± 2.05%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3508.782778865013,
+ "range": "± 0.56%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5922.218199608615,
+ "range": "± 1.14%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3784.0782778864186,
+ "range": "± 2.04%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5629.767123287557,
+ "range": "± 1.69%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 9115.519569471731,
+ "range": "± 1.50%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5513.7573385518,
+ "range": "± 1.42%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7838.204500978491,
+ "range": "± 0.67%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12506.34931506864,
+ "range": "± 1.54%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2445.7217221134906,
+ "range": "± 1.05%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 134329.7710371817,
+ "range": "± 1.55%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 134210.29158512584,
+ "range": "± 1.85%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 24368.281800391516,
+ "range": "± 1.18%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 248.36751467710465,
+ "range": "± 1.07%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1140.724461839533,
+ "range": "± 1.06%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "distinct": true,
+ "id": "3d13c0d5dcf8730a67b70fa7fb03b4556b5cc0fe",
+ "message": "Update CHANGELOG",
+ "timestamp": "2026-06-08T20:09:20+01:00",
+ "tree_id": "9f1226f877cdefc8b3535ea39653b63784e0ce43",
+ "url": "https://github.com/phpbench/phpbench/commit/3d13c0d5dcf8730a67b70fa7fb03b4556b5cc0fe"
+ },
+ "date": 1780945808169,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1417.408219178083,
+ "range": "± 1.05%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 76.2197651663393,
+ "range": "± 2.33%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 66.30782778864877,
+ "range": "± 2.39%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 947.3890410958861,
+ "range": "± 0.79%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7280.481213307257,
+ "range": "± 1.38%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 339.1555772994127,
+ "range": "± 1.78%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 332.60958904109884,
+ "range": "± 2.69%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 329.9021526418786,
+ "range": "± 1.98%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2287.749510763263,
+ "range": "± 1.20%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3437.1497064579758,
+ "range": "± 1.06%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5733.1780821917555,
+ "range": "± 0.95%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3610.652641878668,
+ "range": "± 1.34%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5460.598825831672,
+ "range": "± 1.21%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 9103.078277886347,
+ "range": "± 1.74%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5301.772994129156,
+ "range": "± 1.73%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7797.063600782756,
+ "range": "± 1.90%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12539.71428571425,
+ "range": "± 2.09%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2432.646575342472,
+ "range": "± 1.02%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 133604.2328767113,
+ "range": "± 1.12%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 132292.60469667264,
+ "range": "± 1.48%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 24563.71428571384,
+ "range": "± 1.38%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 248.04970645792577,
+ "range": "± 1.88%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1137.8266144813858,
+ "range": "± 0.51%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "daniel@dantleech.com",
+ "name": "Daniel Leech",
+ "username": "dantleech"
+ },
+ "distinct": true,
+ "id": "7493f63fd8188e25d917bfdb29f10a797c2c55e2",
+ "message": "Update doc to provide more reliable diff example",
+ "timestamp": "2026-06-09T20:39:02+01:00",
+ "tree_id": "dfafcbae5674844f5291d46bca7627094f5c4226",
+ "url": "https://github.com/phpbench/phpbench/commit/7493f63fd8188e25d917bfdb29f10a797c2c55e2"
+ },
+ "date": 1781033998584,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1443.2962818003746,
+ "range": "± 1.71%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 73.76810176125302,
+ "range": "± 2.42%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 66.04520547945077,
+ "range": "± 2.52%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 964.1884540117344,
+ "range": "± 2.11%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7105.36086105681,
+ "range": "± 2.76%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 336.6780821917804,
+ "range": "± 2.93%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 336.5851272015634,
+ "range": "± 2.88%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 332.2690802348335,
+ "range": "± 2.01%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2238.428571428585,
+ "range": "± 2.34%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3367.2602739725453,
+ "range": "± 2.42%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5614.600782778897,
+ "range": "± 2.91%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3640.575342465745,
+ "range": "± 2.20%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5444.502935420702,
+ "range": "± 1.53%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 8932.369863013475,
+ "range": "± 2.75%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5240.075342465658,
+ "range": "± 1.69%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7524.369863013677,
+ "range": "± 1.16%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12387.089041095656,
+ "range": "± 2.45%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2762.28180039137,
+ "range": "± 1.47%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 119127.34050880629,
+ "range": "± 1.07%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 119865.00782778696,
+ "range": "± 0.73%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 23501.30332681042,
+ "range": "± 1.47%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 232.99041095890524,
+ "range": "± 1.75%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1166.512524461838,
+ "range": "± 1.77%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ }
+ ]
+ },
+ {
+ "commit": {
+ "author": {
+ "email": "dan.t.leech@gmail.com",
+ "name": "dantleech",
+ "username": "dantleech"
+ },
+ "committer": {
+ "email": "noreply@github.com",
+ "name": "GitHub",
+ "username": "web-flow"
+ },
+ "distinct": true,
+ "id": "eac0a110acba2124a29d06481f53d7d0401e54b5",
+ "message": "Do not show \"ERR\" if baseline not there (#1154)",
+ "timestamp": "2026-06-14T19:27:50+01:00",
+ "tree_id": "58762b597ab4f798e535dcf5191985327baad2ae",
+ "url": "https://github.com/phpbench/phpbench/commit/eac0a110acba2124a29d06481f53d7d0401e54b5"
+ },
+ "date": 1781461709264,
+ "tool": "customSmallerIsBetter",
+ "benches": [
+ {
+ "name": "ExpressionGeneratorBench::benchGenerate",
+ "value": 7339.508219178014,
+ "range": "± 1.64%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,0)",
+ "value": 328.2191780821927,
+ "range": "± 2.68%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,0)",
+ "value": 331.6164383561675,
+ "range": "± 1.85%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,0)",
+ "value": 331.52054794520336,
+ "range": "± 2.56%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,25)",
+ "value": 2227.069471624254,
+ "range": "± 0.99%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,25)",
+ "value": 3381.132093933442,
+ "range": "± 1.41%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,25)",
+ "value": 5735.424657534215,
+ "range": "± 0.66%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,50)",
+ "value": 3627.748532289599,
+ "range": "± 1.53%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,50)",
+ "value": 5428.977495107582,
+ "range": "± 2.08%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,50)",
+ "value": 8860.753424657505,
+ "range": "± 1.52%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (text,75)",
+ "value": 5174.2622309198005,
+ "range": "± 2.61%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (bar_chart_aggregate,75)",
+ "value": 7671.75342465756,
+ "range": "± 2.15%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "ComponentGeneratorBench::benchGenerate (table_aggregate,75)",
+ "value": 12645.741682974563,
+ "range": "± 1.65%",
+ "unit": "μs",
+ "extra": "10 iterations, 2 revs"
+ },
+ {
+ "name": "HtmlRendererBench::benchRender",
+ "value": 2487.1463796478083,
+ "range": "± 0.76%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "AssertionProcessorBench::benchAssert",
+ "value": 954.4041095890321,
+ "range": "± 0.59%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp. w/tol)",
+ "value": 74.5751467710364,
+ "range": "± 2.26%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "ParserBench::benchEvaluate (comp.)",
+ "value": 66.43992172211348,
+ "range": "± 1.34%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRowArrays",
+ "value": 246.16438356164514,
+ "range": "± 2.02%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "DataFrameBench::benchCreateFromRecords",
+ "value": 1125.9391389432392,
+ "range": "± 0.62%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "VariantSummaryFormatterBench::benchFormat",
+ "value": 1423.0765166340632,
+ "range": "± 0.87%",
+ "unit": "μs",
+ "extra": "10 iterations, 10 revs"
+ },
+ {
+ "name": "RunCommandBench::benchDefault",
+ "value": 130768.33072406825,
+ "range": "± 1.07%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchInBand",
+ "value": 129478.91780822005,
+ "range": "± 1.43%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ },
+ {
+ "name": "RunCommandBench::benchNoEnv",
+ "value": 23535.882583170496,
+ "range": "± 0.99%",
+ "unit": "μs",
+ "extra": "10 iterations, 1 revs"
+ }
+ ]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/benchmarks/index.html b/benchmarks/index.html
new file mode 100644
index 000000000..6c887805e
--- /dev/null
+++ b/benchmarks/index.html
@@ -0,0 +1,281 @@
+
+
+
+
+
+
+ Benchmarks
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bin/build-phar.sh b/bin/build-phar.sh
index a90984480..5c572d349 100755
--- a/bin/build-phar.sh
+++ b/bin/build-phar.sh
@@ -5,7 +5,7 @@ set -e
mkdir -p build
cd build
-wget -O box.phar https://github.com/box-project/box/releases/download/4.5.1/box.phar
+wget -O box.phar https://github.com/box-project/box/releases/download/3.11.1/box.phar
php box.phar compile -c ../box.json.gh-release
if [[ "$GPG_SIGNING" != '' ]] ; then
@@ -16,7 +16,7 @@ if [[ "$GPG_SIGNING" != '' ]] ; then
echo "Sign Phar"
- echo "$GPG_PASSPHRASE" | gpg --command-fd 0 --passphrase-fd 0 --pinentry-mode loopback -u 676674024C0D866B --batch --detach-sign --armor --output phpbench.phar.asc phpbench.phar
+ echo "$GPG_PASSPHRASE" | gpg --command-fd 0 --passphrase-fd 0 --pinentry-mode loopback -u 15E1F8E2B149E6F5 --batch --detach-sign --armor --output phpbench.phar.asc phpbench.phar
fi
cd -
diff --git a/box.json.dist b/box.json.dist
index b41b5a6f9..076be86ac 100644
--- a/box.json.dist
+++ b/box.json.dist
@@ -21,6 +21,7 @@
],
"git-commit-short": "git_version",
"intercept": true,
+ "key": ".travis/phpbench-phar-private.pem",
"main": "bin/phpbench.php",
"output": "phpbench.phar",
"stub": true
diff --git a/box.json.gh-release b/box.json.gh-release
index 255f2a0a7..e857432fe 100644
--- a/box.json.gh-release
+++ b/box.json.gh-release
@@ -2,14 +2,14 @@
"compression": "GZ",
"directories": [
"lib",
- "extensions",
- "templates"
+ "extensions"
],
"files": [
"LICENSE"
],
"finder": [
{
+ "name": "{\\.[php]}",
"exclude": [
"tests",
"test"
diff --git a/box.phar b/box.phar
new file mode 100755
index 000000000..ce6b69a6d
Binary files /dev/null and b/box.phar differ
diff --git a/compose.yaml b/compose.yaml
deleted file mode 100755
index 5f76bfe81..000000000
--- a/compose.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-services:
- php:
- image: php:8.4.0RC2-zts-alpine3.20
- volumes:
- - .:/app
diff --git a/composer.json b/composer.json
index 2b056683a..57c43a8e6 100644
--- a/composer.json
+++ b/composer.json
@@ -2,114 +2,88 @@
"name": "phpbench/phpbench",
"description": "PHP Benchmarking Framework",
"license": "MIT",
- "keywords": [
- "benchmarking",
- "optimization",
- "performance",
- "profiling",
- "testing"
- ],
"authors": [
{
"name": "Daniel Leech",
"email": "daniel@dantleech.com"
}
],
+ "minimum-stability": "dev",
+ "prefer-stable": true,
"require": {
- "php": "^8.2",
+ "php": "^7.2 || ^8.0",
"ext-dom": "*",
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"ext-tokenizer": "*",
- "doctrine/annotations": "^2.0",
- "phpbench/container": "^2.2",
- "psr/log": "^1.1 || ^2.0 || ^3.0",
+ "beberlei/assert": "^2.4 || ^3.0",
+ "doctrine/annotations": "^1.2.7",
+ "doctrine/dbal": "~2.5",
+ "padraic/phar-updater": "^1.0",
+ "phpbench/container": "^2.1",
+ "phpbench/dom": "~0.3.0",
+ "psr/log": "^1.1",
"seld/jsonlint": "^1.1",
- "symfony/console": "^6.1 || ^7.0 || ^8.0",
- "symfony/filesystem": "^6.1 || ^7.0 || ^8.0",
- "symfony/finder": "^6.1 || ^7.0 || ^8.0",
- "symfony/options-resolver": "^6.1 || ^7.0 || ^8.0",
- "symfony/process": "^6.1 || ^7.0 || ^8.0",
- "webmozart/glob": "^4.6"
+ "symfony/console": "^4.2 || ^5.0",
+ "symfony/filesystem": "^4.2 || ^5.0",
+ "symfony/finder": "^4.2 || ^5.0",
+ "symfony/options-resolver": "^4.2 || ^5.0",
+ "symfony/process": "^4.2 || ^5.0",
+ "webmozart/path-util": "^2.3"
},
"require-dev": {
- "dantleech/invoke": "^2.0",
- "ergebnis/composer-normalize": "^2.39",
- "jangregor/phpstan-prophecy": "^2.0",
- "php-cs-fixer/shim": "^3.9",
- "phpspec/prophecy": "^1.22",
- "phpstan/extension-installer": "^1.1",
- "phpstan/phpstan": "^2.0",
- "phpstan/phpstan-phpunit": "^2.0",
- "phpunit/phpunit": "^11.5",
- "rector/rector": "^2.2",
- "sebastian/exporter": "^6.3.2",
- "symfony/error-handler": "^6.1 || ^7.0 || ^8.0",
- "symfony/var-dumper": "^6.1 || ^7.0 || ^8.0"
+ "dantleech/invoke": "^1.2",
+ "friendsofphp/php-cs-fixer": "^2.13.1",
+ "jangregor/phpstan-prophecy": "^0.8.1",
+ "phpspec/prophecy": "^1.12",
+ "phpstan/phpstan": "^0.12.7",
+ "phpunit/phpunit": "^8.5.8 || ^9.0",
+ "symfony/error-handler": "^5.2",
+ "symfony/var-dumper": "^4.0 || ^5.0"
+ },
+ "scripts": {
+ "integrate": [
+ "vendor/bin/php-cs-fixer fix",
+ "vendor/bin/phpstan analyse -c phpstan.neon.dist",
+ "vendor/bin/phpunit",
+ "bin/phpbench run --revs=1 --iterations=1",
+ "bin/phpbench run --profile=examples --revs=1 --iterations=1",
+ "@docs"
+ ],
+ "docs": [
+ "rm -Rf docs/build",
+ "bin/phpbench config:dump-reference > docs/configuration.rst",
+ "make -C docs html"
+ ]
},
"suggest": {
"ext-xdebug": "For Xdebug profiling extension."
},
- "minimum-stability": "stable",
- "prefer-stable": true,
+ "config": {
+ "sort-packages": true
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
"autoload": {
"psr-4": {
"PhpBench\\": "lib/",
- "PhpBench\\Extensions\\XDebug\\": "extensions/xdebug/lib/"
- },
- "files": [
- "lib/Report/Func/functions.php"
- ]
+ "PhpBench\\Extensions\\XDebug\\": "extensions/xdebug/lib/",
+ "PhpBench\\Extensions\\Reports\\": "extensions/reports/lib/"
+ }
},
"autoload-dev": {
"psr-4": {
+ "PhpBench\\Tests\\": "tests/",
"PhpBench\\Examples\\": "examples/",
- "PhpBench\\Extensions\\XDebug\\Tests\\": "extensions/xdebug/tests/",
- "PhpBench\\Tests\\": "tests/"
+ "PhpBench\\Extensions\\XDebug\\Tests\\": "extensions/xdebug/tests/"
}
},
"bin": [
"bin/phpbench"
- ],
- "config": {
- "allow-plugins": {
- "ergebnis/composer-normalize": true,
- "phpstan/extension-installer": true
- },
- "audit": {
- "block-insecure": false
- },
- "sort-packages": true
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.2-dev"
- }
- },
- "scripts": {
- "docs": [
- "rm -Rf docs/build",
- "bin/phpbench doc:config-reference > docs/configuration.rst",
- "bin/phpbench doc:service-options docs/report-generators/options generator",
- "bin/phpbench doc:service-options docs/report-renderers/options renderer",
- "bin/phpbench doc:service-options docs/report-components/options component",
- "bin/phpbench doc:service-options docs/executors/options executor",
- "make -C docs html"
- ],
- "integrate": [
- "@composer normalize --indent-size=4 --indent-style=space",
- "vendor/bin/php-cs-fixer fix",
- "vendor/bin/phpstan analyse -c phpstan.neon.dist --memory-limit=-1",
- "vendor/bin/phpunit",
- "bin/phpbench run --revs=1 --iterations=2",
- "bin/phpbench run --profile=examples --revs=1 --iterations=1 --report=examples",
- "@docs",
- "@schema"
- ],
- "schema": [
- "bin/phpbench doc:config-schema > phpbench.schema.json"
- ]
- }
+ ]
}
diff --git a/docs/.doctor-rst.yaml b/docs/.doctor-rst.yaml
index d4e0a9032..218b969cc 100644
--- a/docs/.doctor-rst.yaml
+++ b/docs/.doctor-rst.yaml
@@ -6,6 +6,7 @@ rules:
composer_dev_option_at_the_end: ~
correct_code_block_directive_based_on_the_content: ~
deprecated_directive_should_have_version: ~
+ indention: ~
lowercase_as_in_use_statements: ~
max_blank_lines:
max: 2
@@ -28,6 +29,7 @@ rules:
valid_inline_highlighted_namespaces: ~
valid_use_statements: ~
versionadded_directive_should_have_version: ~
+ yaml_instead_of_yml_suffix: ~
versionadded_directive_major_version:
major_version: 1
diff --git a/docs/_templates/navigation.html b/docs/_templates/navigation.html
index 2b47fb096..83c4d3107 100644
--- a/docs/_templates/navigation.html
+++ b/docs/_templates/navigation.html
@@ -1,5 +1,5 @@
-{{ toctree(collapse=True,includehidden=False,maxdepth=3) }}
+{{ toctree(collapse=True,includehidden=False) }}
{% if theme_extra_nav_links %}
diff --git a/docs/annotributes.rst b/docs/annotributes.rst
index 87d2513bb..761a40567 100644
--- a/docs/annotributes.rst
+++ b/docs/annotributes.rst
@@ -1,16 +1,12 @@
Annotributes
============
-Configure your benchmarks with **Annotations** or, if you have PHP 8, **Attributes**. Note that some
-of these settings (e.g. :ref:`configuration_runner_revs`,
-:ref:`configuration_runner_iterations`) can be set globaly in the
-:doc:`configuration`.
+Configure your benchmarks with **Annotations** or, if you have PHP 8, **Attributes**.
.. contents::
:depth: 1
:local:
-
.. _metadata_revolutions:
Revolutions
@@ -38,7 +34,7 @@ Revolutions can be specified using the ``@Revs`` annotation:
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,revs,benchTime
@@ -86,7 +82,7 @@ Iterations can be specified using the ``@Iterations`` annotation:
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,iterations,benchTime
@@ -120,7 +116,7 @@ your environment:
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,beforeMethods,afterMethods,benchTime
@@ -152,7 +148,7 @@ These methods will be executed by the runner once per benchmark class.
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,beforeClassMethods,afterClassMethods,benchTime
@@ -179,7 +175,7 @@ Parameter sets can be provided to benchmark subjects:
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,paramProviders
@@ -198,7 +194,7 @@ For example the above could also be returned as an array:
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,paramIterable
@@ -222,7 +218,7 @@ parameters will be generated:
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,paramMultiple
@@ -259,7 +255,7 @@ You can assign benchmark subjects to groups using the ``@Groups`` annotation.
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,benchTime,groups
@@ -280,7 +276,7 @@ You can skip subjects by using the ``@Skip`` annotation:
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,skip
@@ -301,7 +297,7 @@ the system recover. Use the ``@Sleep`` annotation, specifying the number of
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,benchTime,sleep
@@ -329,7 +325,7 @@ Specify *output* time units using the ``@OutputTimeUnit`` annotation
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,benchTime,outputTimeUnit
@@ -363,7 +359,7 @@ are executed within a single time unit:
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,benchTime,outputMode
@@ -388,7 +384,7 @@ actually measuring the revolutions time.
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,benchTime,warmup
@@ -413,7 +409,7 @@ before an iteration timesout and fails. The following example will fail after
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,benchTime,timeout
@@ -437,7 +433,7 @@ For example, assert that the :ref:`KDE mode` is less than 200 mi
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,benchTime,assert
@@ -447,7 +443,7 @@ You can also specify assertions from the command line:
$ phpbench run --assert='mode(variant.time.avg) < 10 hours'
-See :doc:`guides/assertions` for more information.
+See :doc:`assertions` for more information.
.. _cartesian product: https://en.wikipedia.org/wiki/Cartesian_product
@@ -468,7 +464,7 @@ Override how the variant results are formatted in the progress output.
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,benchTime,format
@@ -500,7 +496,7 @@ Use to create more stable sets of iterations.
.. tab:: Attributes
- .. codeimport:: ../examples/Attributes/AttributedBench.php
+ .. codeimport:: ../examples/Attributes/AttriutedBench.php
:language: php
:sections: all,retrythreshold,benchTime
diff --git a/docs/guides/assertions.rst b/docs/assertions.rst
similarity index 78%
rename from docs/guides/assertions.rst
rename to docs/assertions.rst
index c67c3cc8d..74d2ae180 100644
--- a/docs/guides/assertions.rst
+++ b/docs/assertions.rst
@@ -4,14 +4,14 @@ Assertions
Assertions are executed against each variant of the subject and can be added
to your benchmarks as follows:
-.. codeimport:: ../../examples/Assertion/ExampleAssertionsBench.php
+.. codeimport:: ../examples/Assertion/ExampleAssertionsBench.php
:language: php
:sections: all,bench_time
Above we assert that the KDE mode of the average iterations times is less than
200 milliseconds give or take a tolerance of 10%.
-.. codeimport:: ../../examples/Assertion/ExampleAssertionsBench.php
+.. codeimport:: ../examples/Assertion/ExampleAssertionsBench.php
:language: php
:sections: all,bench_time_baseline
@@ -23,7 +23,7 @@ Data
PHPBench provides the aggregated iteration results for the current `variant`
and, if a :ref:`reference [` is specified, the `baseline`.
-.. codeimport:: ../../examples/Assertion/ExampleAssertionsBench.php
+.. codeimport:: ../examples/Assertion/ExampleAssertionsBench.php
:language: php
:sections: data_access
@@ -36,4 +36,4 @@ Assertion Language
------------------
Assertions are created using the :doc:`PHPBench Expression
-Language<../expression>`. Each assertion must be a comparison.
+Language`. Each assertion must be a comparison.
diff --git a/docs/guides/benchmark-runner.rst b/docs/benchmark-runner.rst
similarity index 93%
rename from docs/guides/benchmark-runner.rst
rename to docs/benchmark-runner.rst
index 313d84b25..892873a0a 100644
--- a/docs/guides/benchmark-runner.rst
+++ b/docs/benchmark-runner.rst
@@ -52,13 +52,6 @@ valid:
$ phpbench run /path/to --filter=HashBench::benchFoo
$ phpbench run /path/to --filter=Hash.*
-In addition the ``--variant`` option allows you to filter by a specific
-parameter set name:
-
-.. code-block:: bash
-
- $ phpbench run /path/to --filter=Hash.* --variant=md5
-
.. _overriding_iterations_and_revolutions:
Overriding Iterations and Revolutions
@@ -116,7 +109,7 @@ be specified directly using the ``--report`` option:
$ phpbench run /path/to/HashBench.php --report=default
-See the :doc:`reports` guide for more information on how you can
+See the :doc:`reports` chapter for more information on how you can
configure reports.
.. note::
@@ -158,9 +151,13 @@ For example, to render a HTML document:
.. code-block:: bash
- $ phpbench run /path/to/HashBench.php --report=default --output=delimited
+ $ phpbench run /path/to/HashBench.php --report=default --output=html
+
+Example of HTML output:
+
+.. image:: images/html.png
-See the :doc:`../report-renderers` reference for more information.
+See the :doc:`report-renderers` chapter for more information.
Storing Results
---------------
@@ -196,7 +193,7 @@ By default PHPBench issues a single ``.`` for each benchmark subject executed.
This is the ``dots`` progress reporter. Different progress reporters can be
specified using the ``--progress`` option:
-.. figure:: ../images/blinken.gif
+.. figure:: images/blinken.gif
blinken progress logger.
@@ -213,7 +210,6 @@ The built-in progress loggers are:
- ``blinken``: Highly visual progress logger.
- ``histogram``: Shows a histogram with 8 vertical levels and 16 bins for each
iteration set.
-- ``json``: Stream JSON results.
All of the progress reports contain the following footer:
@@ -236,7 +232,7 @@ Configuration File
------------------
A custom configuration file can be specified with the ``--config`` option. See
-the :doc:`../configuration` reference for more information on configuration.
+the :doc:`configuration` chapter for more information on configuration.
Exit codes
----------
diff --git a/docs/conf.py b/docs/conf.py
index 2e8511cbb..e512a14f7 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -150,7 +150,7 @@
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
-html_last_updated_fmt = '%b %d, %Y'
+#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
diff --git a/docs/configuration-prelude.rst b/docs/configuration-prelude.rst
index 786d00d5c..ea3995257 100644
--- a/docs/configuration-prelude.rst
+++ b/docs/configuration-prelude.rst
@@ -6,7 +6,6 @@ that order and use one if it exists.
.. code-block:: json
{
- "$schema":"./vendor/phpbench/phpbench/phpbench.schema.json",
"runner.bootstrap": "vendor/autoload.php",
"runner.path": "path/to/benchmarks",
"report.outputs": {
@@ -22,12 +21,8 @@ that order and use one if it exists.
}
}
-You can include more configuration files with the ``$include`` and
-``$include-glob`` directives:
+.. note::
-.. code-block:: json
-
- {
- "$include": ["path/to/config.json"],
- "$include-glob": ["path/to/*.json"],
- }
+ Typically you should use ``phpbench.json.dist`` in your projects. This
+ allows the end-user of your library to override your configuration by creating
+ ``phpbench.json``.
diff --git a/docs/configuration.rst b/docs/configuration.rst
index 6d4f0f377..5337108d8 100644
--- a/docs/configuration.rst
+++ b/docs/configuration.rst
@@ -12,17 +12,6 @@ Core
Extension class: ``PhpBench\Extension\CoreExtension``
-.. _configuration_$schema:
-
-$schema
-~~~~~~~
-
-JSON schema location, e.g. ``./vendor/phpbench/phpbench/phpbench.schema.json``
-
-Default: ``NULL``
-
-Types: ``["string","null"]``
-
.. _configuration_core_debug:
core.debug
@@ -43,7 +32,7 @@ List of additional extensions to enable
Default: ``[]``
-Types: ``["string[]"]``
+Types: ``["array"]``
.. _configuration_core_working_dir:
@@ -52,7 +41,7 @@ core.working_dir
Working directory to use
-Default: ``/home/daniel/www/phpbench/phpbench``
+Default: ``"\/home\/daniel\/www\/phpbench\/phpbench"``
Types: ``["string"]``
@@ -63,7 +52,7 @@ core.config_path
Alternative path to a PHPBench configuration file (default is ``phpbench.json``
-Default: ``NULL``
+Default: ``null``
Types: ``["string","null"]``
@@ -137,7 +126,7 @@ runner.bootstrap
Path to bootstrap (e.g. ``vendor/autoload.php``)
-Default: ``NULL``
+Default: ``null``
Types: ``["string","null"]``
@@ -192,7 +181,7 @@ runner.path
Path or paths to the benchmarks
-Default: ``NULL``
+Default: ``null``
Types: ``["string","array","null"]``
@@ -203,7 +192,7 @@ runner.php_binary
Specify a PHP binary to use when executing out-of-band benchmarks, e.g. ``/usr/bin/php6``, defaults to the version of PHP used to invoke PHPBench
-Default: ``NULL``
+Default: ``null``
Types: ``["string","null"]``
@@ -236,21 +225,10 @@ runner.php_wrapper
Wrap the PHP binary with this command (e.g. ``blackfire run``)
-Default: ``NULL``
+Default: ``null``
Types: ``["string","null"]``
-.. _configuration_runner_php_env:
-
-runner.php_env
-~~~~~~~~~~~~~~
-
-Key-value set of environment variables to pass to the PHP process
-
-Default: ``NULL``
-
-Types: ``["array","null"]``
-
.. _configuration_runner_progress:
runner.progress
@@ -258,7 +236,7 @@ runner.progress
Default progress logger to use
-Default: ``verbose``
+Default: ``"verbose"``
Types: ``["string"]``
@@ -269,8 +247,7 @@ runner.progress_summary_variant_format
Expression used to render the summary text default progress loggers
-Default: ``label("Mo") ~ display_as_time(mode(variant.time.avg), coalesce(subject.time_unit,"time"), subject.time_precision, subject.time_mode) ~
-" (" ~ rstdev(variant.time.avg) ~ ")"``
+Default: ``"\"Mo\" ~ display_as_time(mode(variant.time.avg), coalesce(subject.time_unit,\"time\"), subject.time_precision, subject.time_mode) ~ \n\" (\" ~ rstdev(variant.time.avg) ~ \")\""``
Types: ``["string"]``
@@ -281,12 +258,7 @@ runner.progress_summary_baseline_format
When the a comparison benchmark is referenced, alternative expression used to render the summary text default progress loggers
-Default: ``"[" ~
-label("Mo") ~ display_as_time(mode(variant.time.avg), coalesce(subject.time_unit,"time"), subject.time_precision, subject.time_mode) ~
-" vs. " ~
-label("Mo") ~ display_as_time(mode(baseline.time.avg), coalesce(subject.time_unit,"time"), subject.time_precision, subject.time_mode) ~ "] " ~
-percent_diff(mode(baseline.time.avg), mode(variant.time.avg), (rstdev(variant.time.avg) * 2)) ~
-" (" ~ rstdev(variant.time.avg) ~ ")"``
+Default: ``"\"[\" ~ \n\"Mo\" ~ display_as_time(mode(variant.time.avg), coalesce(subject.time_unit,\"time\"), subject.time_precision, subject.time_mode) ~\n\" vs \" ~ \n\"Mo\" ~ display_as_time(mode(baseline.time.avg), coalesce(subject.time_unit,\"time\"), subject.time_precision, subject.time_mode) ~ \"] \" ~ \npercent_diff(mode(baseline.time.avg), mode(variant.time.avg), (rstdev(variant.time.avg) * 2)) ~\n\" (\" ~ rstdev(variant.time.avg) ~ \")\""``
Types: ``["string"]``
@@ -297,7 +269,7 @@ runner.remote_script_path
PHPBench generates a PHP file for out-of-band benchmarks which is executed, this setting specifies the path to this file. When NULL a file in the systems temporary directory will be used
-Default: ``NULL``
+Default: ``null``
Types: ``["string","null"]``
@@ -319,7 +291,7 @@ runner.assert
Default :ref:`metadata_assertions`
-Default: ``NULL``
+Default: ``null``
Types: ``["null","string","array"]``
@@ -330,7 +302,7 @@ runner.executor
Default executor
-Default: ``NULL``
+Default: ``null``
Types: ``["null","string"]``
@@ -341,7 +313,7 @@ runner.format
Default :ref:`metadata_format`
-Default: ``NULL``
+Default: ``null``
Types: ``["null","string"]``
@@ -352,7 +324,7 @@ runner.iterations
Default :ref:`metadata_iterations`
-Default: ``NULL``
+Default: ``null``
Types: ``["null","int","array"]``
@@ -363,7 +335,7 @@ runner.output_mode
Default :ref:`output mode `
-Default: ``NULL``
+Default: ``null``
Types: ``["null","string"]``
@@ -374,7 +346,7 @@ runner.time_unit
Default :ref:`time unit `
-Default: ``NULL``
+Default: ``null``
Types: ``["null","string"]``
@@ -385,7 +357,7 @@ runner.retry_threshold
Default :ref:`metadata_retry_threshold`
-Default: ``NULL``
+Default: ``null``
Types: ``["null","int","float"]``
@@ -396,7 +368,7 @@ runner.revs
Default number of :ref:`metadata_revolutions`
-Default: ``NULL``
+Default: ``null``
Types: ``["null","int","array"]``
@@ -407,7 +379,7 @@ runner.timeout
Default :ref:`metadata_timeout`
-Default: ``NULL``
+Default: ``null``
Types: ``["null","float","int"]``
@@ -418,7 +390,7 @@ runner.warmup
Default :ref:`metadata_warmup`
-Default: ``NULL``
+Default: ``null``
Types: ``["null","int","array"]``
@@ -427,23 +399,12 @@ Types: ``["null","int","array"]``
runner.subject_pattern
~~~~~~~~~~~~~~~~~~~~~~
-Subject pattern (regex) to use when finding benchmarks
+Subject prefix to use when finding benchmarks
-Default: ``^bench``
+Default: ``"^bench"``
Types: ``["string"]``
-.. _configuration_runner_file_pattern:
-
-runner.file_pattern
-~~~~~~~~~~~~~~~~~~~
-
-Consider file names matching this pattern to be benchmarks. NOTE: In 2.0 this will be set to ``*Bench.php``
-
-Default: ``NULL``
-
-Types: ``["string","null"]``
-
Report
------
@@ -471,39 +432,6 @@ Default: ``[]``
Types: ``["array"]``
-.. _configuration_report_components:
-
-report.components
-~~~~~~~~~~~~~~~~~
-
-Component configurations, see :doc:`report-components`
-
-Default: ``[]``
-
-Types: ``["array"]``
-
-.. _configuration_report_template_paths:
-
-report.template_paths
-~~~~~~~~~~~~~~~~~~~~~
-
-List of paths to load templates from
-
-Default: ``["\/home\/daniel\/www\/phpbench\/phpbench\/lib\/Extension\/..\/..\/templates"]``
-
-Types: ``["array"]``
-
-.. _configuration_report_template_map:
-
-report.template_map
-~~~~~~~~~~~~~~~~~~~
-
-Namespace prefix to template path map for object rendering
-
-Default: ``{"PhpBench\\Report\\Model":"html","PhpBench\\Expression\\Ast":"html\/node"}``
-
-Types: ``["array"]``
-
Expression
----------
@@ -527,34 +455,10 @@ expression.theme
Select a theme to use
-Default: ``solarized``
+Default: ``"solarized"``
Types: ``["string"]``
-.. _configuration_expression_memory_unit_prefix:
-
-expression.memory_unit_prefix
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-By default use ``decimal`` (1kb = 1000 bytes) or ``binary`` (1KiB = 1024 bytes) when displaying memory
-
-Default: ``decimal``
-
-Types: ``["string"]``
-
-Allowed values: ``["binary","decimal"]``
-
-.. _configuration_expression_strip_tailing_zeros:
-
-expression.strip_tailing_zeros
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Do not display meaningless zeros after the decimal place
-
-Default: ``false``
-
-Types: ``["bool"]``
-
Storage
-------
@@ -567,7 +471,7 @@ storage.driver
Storage driver to use
-Default: ``xml``
+Default: ``"xml"``
Types: ``["string"]``
@@ -578,21 +482,10 @@ storage.xml_storage_path
Path to store benchmark runs when they are stored with ``--store`` or ``--tag=foo``
-Default: ``.phpbench/storage``
+Default: ``".phpbench\/storage"``
Types: ``["string"]``
-.. _configuration_storage_store_binary:
-
-storage.store_binary
-~~~~~~~~~~~~~~~~~~~~
-
-If binary and serialized parameter values should be stored
-
-Default: ``false``
-
-Types: ``["boolean"]``
-
XDebug
------
@@ -605,7 +498,7 @@ xdebug.command_handler_output_dir
Output directory for generated XDebug profiles
-Default: ``.phpbench/xdebug-profile``
+Default: ``".phpbench\/xdebug-profile"``
Types: ``["string"]``
@@ -621,9 +514,9 @@ console.ansi
Enable or disable ANSI control characters (e.g. console colors)
-Default: ``NULL``
+Default: ``true``
-Types: ``["bool","null"]``
+Types: ``["bool"]``
.. _configuration_console_disable_output:
@@ -643,7 +536,7 @@ console.output_stream
Change the normal output stream - the output stream used for reports
-Default: ``php://stdout``
+Default: ``"php:\/\/stdout"``
Types: ``["string"]``
@@ -654,7 +547,7 @@ console.error_stream
Change the error output stream - the output stream used for diagnostics (e.g. progress loggers use this stream)
-Default: ``php://stderr``
+Default: ``"php:\/\/stderr"``
Types: ``["string"]``
diff --git a/docs/contents.rst b/docs/contents.rst
index 56a53a0cc..92712d7ea 100644
--- a/docs/contents.rst
+++ b/docs/contents.rst
@@ -8,9 +8,11 @@ PHPBench is a benchmarking framework for PHP. Find it on Github_.
installing
quick-start
- guides
+ writing-benchmarks
+ reports
+ benchmark-runner
+ regression-testing
reference
- examples
extensions
customisation
development
@@ -29,6 +31,6 @@ Indices and tables
index
configuration-prelude
- executors/options/_memory_centric_microtime.rst
+
.. _Github: https://github.com/phpbench/phpbench
diff --git a/docs/customisation.rst b/docs/customisation.rst
index 4f54cadfa..c889dc084 100644
--- a/docs/customisation.rst
+++ b/docs/customisation.rst
@@ -8,5 +8,4 @@ Customisation
customisation/command
customisation/executor
customisation/progress-logger
- customisation/environment-provider
customisation/report
diff --git a/docs/customisation/environment-provider.rst b/docs/customisation/environment-provider.rst
deleted file mode 100644
index 1a6366467..000000000
--- a/docs/customisation/environment-provider.rst
+++ /dev/null
@@ -1,22 +0,0 @@
-Environment Provider
-====================
-
-Environment providers are used to record information about the running environment,
-they are called before the benchmark is run.
-
-Create a new environment provider class similar to the following:
-
-.. codeimport:: ../../examples/Extension/Environment/HomeProvider.php
- :language: php
-
-And register with your DI container:
-
-.. codeimport:: ../../examples/Extension/AcmeExtension.php
- :language: php
- :sections: all,env_provider_di
-
-Run it with:
-
-.. code-block:: bash
-
- $ phpbench run --report=env
diff --git a/docs/customisation/extension.rst b/docs/customisation/extension.rst
index 7eba8dd78..5d29146a1 100644
--- a/docs/customisation/extension.rst
+++ b/docs/customisation/extension.rst
@@ -6,7 +6,6 @@ PHPBench allows you to create your own extensions, allowing you to register new:
- :doc:`Benchmark Executors `
- :doc:`Progress Loggers `
- :doc:`Commands `
-- :doc:`Environment Providers `
- :doc:`Reports `
Create a new extension package
@@ -43,8 +42,7 @@ Then it can be registered in ``phpbench.json``:
.. code-block:: javascript
{
- "$schema":"./vendor/phpbench/phpbench/phpbench.schema.json",
- "core.extensions": [
+ "extensions": [
"PhpBench\\Examples\\Extension\\AcmeExtension"
]
}
@@ -75,8 +73,7 @@ You can activate and use your extension as follows ``phpbench.json``:
.. code-block:: javascript
{
- "$schema":"./vendor/phpbench/phpbench/phpbench.schema.json",
- "core.extensions": [
+ "extensions": [
"PhpBench\Examples\Extension\AcmeExtension"
],
"acme.number_of_cats": 8
diff --git a/docs/development/debugging.rst b/docs/development/debugging.rst
index 1482263c6..c6e64074c 100644
--- a/docs/development/debugging.rst
+++ b/docs/development/debugging.rst
@@ -17,7 +17,6 @@ render this template in a local directory and ensure that it is not deleted.
.. code-block:: json
{
- "$schema":"./vendor/phpbench/phpbench/phpbench.schema.json",
"runner.remote_script_path": ".phpbench/script",
"runner.remote_script_remove": false
}
diff --git a/docs/examples.rst b/docs/examples.rst
deleted file mode 100644
index 327bac669..000000000
--- a/docs/examples.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-Examples
---------
-
-This section aims to provide a collection of benchmarking scenarios with examples.
-
-.. toctree::
- :maxdepth: 1
- :glob:
-
- examples/*
diff --git a/docs/examples/config_linters.rst b/docs/examples/config_linters.rst
deleted file mode 100644
index 39c28e026..000000000
--- a/docs/examples/config_linters.rst
+++ /dev/null
@@ -1,28 +0,0 @@
-Config Linters
-==============
-
-.. figure:: ../images/example_config_linter.png
- :alt: Configuration Linters
-
- HTML Output
-
-One approach for comparing classes which implement the same interface is to
-create an abstract `BenchCase` class which sets up the fixtures and delegates
-to a child class to create the concerete instance of the class we want to
-test:
-
-.. codeimport:: ../../examples/Benchmark/ConfigLinters/LinterBenchCase.php
- :language: php
- :sections: all
-
-The concrete benchmarks will look like:
-
-.. codeimport:: ../../examples/Benchmark/ConfigLinters/SeldLinterBench.php
- :language: php
- :sections: all
-
-The report can use the `@Groups` defined in the abstract class to compare
-these benchmarks:
-
-.. literalinclude:: ../../examples/Benchmark/ConfigLinters/config_linters_report.json
- :language: json
diff --git a/docs/examples/file_input.rst b/docs/examples/file_input.rst
deleted file mode 100644
index b66ccce5a..000000000
--- a/docs/examples/file_input.rst
+++ /dev/null
@@ -1,22 +0,0 @@
-File Input
-==========
-
-If your benchmark subject operates on file contents, or can otherwise be
-parameterized from the contents of files.
-
-Given you have a directory ``file-input`` containing a list of files, and each
-of these files represents a benchmarking scenario:
-
-.. codeimport:: ../../examples/Benchmark/FileInput/FileInputBench.php
- :language: php
- :sections: all
-
-Note that we ``yield`` the filename as the key, which is then used as
-the parameter set name:
-
-.. code-block:: text
-
- \PhpBench\Examples\Benchmark\Pattern\FileInput\FileInputBench
-
- benchFind # example1....................I9 ✔ Mo0.205μs (±44.54%)
- benchFind # example2....................I9 ✔ Mo0.337μs (±46.15%)
diff --git a/docs/examples/hashing.rst b/docs/examples/hashing.rst
deleted file mode 100644
index 63c7f9f87..000000000
--- a/docs/examples/hashing.rst
+++ /dev/null
@@ -1,24 +0,0 @@
-Hashing
-=======
-
-.. figure:: ../images/example_hashing.png
- :alt: Hashing Report
-
- Console Output
-
-This hashing benchmark accepts two parameter sources: one for algorithms and the other
-for the size of the string to hash.
-
-Parameters from different providers are combined into a cartesian product,
-meaning that each algorithm will be combined with each size.
-
-.. codeimport:: ../../examples/Benchmark/Hashing/HashingBench.php
- :language: php
- :sections: all
-
-You can configure a bar chart report grouping both by size and algorithm:
-
-.. literalinclude:: ../../examples/Benchmark/Hashing/hashing_report.json
- :language: json
-
-
diff --git a/docs/executors.rst b/docs/executors.rst
index 11fe846de..93c9ae823 100644
--- a/docs/executors.rst
+++ b/docs/executors.rst
@@ -17,10 +17,6 @@ This benchmark records:
- Time in microseconds
- Memory usage
-Options:
-
-.. include:: ./executors/options/_remote.rst
-
.. _executor_local:
``local``
@@ -34,11 +30,6 @@ This benchmark records:
- Time in microseconds
-Options:
-
-- *none*
-
-
.. _executor_debug:
``debug``
@@ -46,23 +37,3 @@ Options:
The debug executor returns a constant set of results, and is useful for
debugging.
-
-Options:
-
-.. include:: ./executors/options/_debug.rst
-
-.. _executor_xdebug_profile:
-
-``xdebug_profile``
-------------------
-
-Execute benchmarks and enable XDebug profiling.
-
-.. note::
-
- You probably want to use the ``xdebug:profile`` command rather than this
- executor.
-
-Options:
-
-.. include:: ./executors/options/_xdebug_profile.rst
diff --git a/docs/executors/options/_debug.rst b/docs/executors/options/_debug.rst
deleted file mode 100644
index 352cf79d4..000000000
--- a/docs/executors/options/_debug.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-
-**times**:
- Type(s): ``array``, Default: ``10``
-
-**spread**:
- Type(s): ``array``, Default: ``0``
-
-**memories**:
- Type(s): ``[null, array]``, Default: ``NULL``
\ No newline at end of file
diff --git a/docs/executors/options/_memory_centric_microtime.rst b/docs/executors/options/_memory_centric_microtime.rst
deleted file mode 100644
index 7cb96111c..000000000
--- a/docs/executors/options/_memory_centric_microtime.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-
-**php_config**:
- Type(s): ``array``, Default: ``[]``
-
- Key value array of ini settings, e.g. ``{"max_execution_time":100}``
-
-**safe_parameters**:
- Type(s): ``bool``, Default: ``true``
-
- INTERNAL: Use process process-safe parameters, this option exists for backwards-compatibility and will be removed in PHPBench 2.0
\ No newline at end of file
diff --git a/docs/executors/options/_remote.rst b/docs/executors/options/_remote.rst
deleted file mode 100644
index 7cb96111c..000000000
--- a/docs/executors/options/_remote.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-
-**php_config**:
- Type(s): ``array``, Default: ``[]``
-
- Key value array of ini settings, e.g. ``{"max_execution_time":100}``
-
-**safe_parameters**:
- Type(s): ``bool``, Default: ``true``
-
- INTERNAL: Use process process-safe parameters, this option exists for backwards-compatibility and will be removed in PHPBench 2.0
\ No newline at end of file
diff --git a/docs/executors/options/_xdebug_profile.rst b/docs/executors/options/_xdebug_profile.rst
deleted file mode 100644
index c6fe85460..000000000
--- a/docs/executors/options/_xdebug_profile.rst
+++ /dev/null
@@ -1,16 +0,0 @@
-
-**php_config**:
- Type(s): ``array``, Default: ``[]``
-
- Key value array of ini settings, e.g. ``{"max_execution_time":100}``
-
-**safe_parameters**:
- Type(s): ``bool``, Default: ``true``
-
- INTERNAL: Use process process-safe parameters, this option exists for backwards-compatibility and will be removed in PHPBench 2.0
-
-**callback**:
- Type(s): ``Closure``, Default: ``{}``
-
-**output_dir**:
- Type(s): ``string``, Default: ``xdebug``
\ No newline at end of file
diff --git a/docs/expression.rst b/docs/expression.rst
index d9159fa53..2c7d99a20 100644
--- a/docs/expression.rst
+++ b/docs/expression.rst
@@ -3,7 +3,7 @@
Expression Language
===================
-PHPBench has a domain-specific expression language which is used when writing assertions.
+PHPBench has a general purpose expression language which is used when writing assertions.
.. contents::
:depth: 3
@@ -20,7 +20,6 @@ Comparators
"<", "Less than"
"<=", "Less than or equal"
"=", "Equal"
- "!=", "Not Equal"
">", "Greater than"
">=", "Greater than or equal"
@@ -57,16 +56,6 @@ Examples:
.. literalinclude:: ../examples/Expression/string_operators_1
-Null Safe Operator
-------------------
-
-Use the null-safe operator to evaluate absence as `null` rather than throwing
-a runtime exception.
-
-Examples:
-
-.. literalinclude:: ../examples/Expression/null_safe_1
-
.. _expr_arithmetic:
Arithmetic
@@ -118,11 +107,8 @@ Memory Units:
"byte", "1 byte"
"kilobyte", "1,000 bytes"
- "kibibyte", "1,024 bytes"
"megabyte", "1,000,000 bytes"
- "mibibyte", "1,048,576 bytes"
"gigabyte", "1,000,000,000 bytes"
- "gibibyte", "1,073,741,824 bytes"
"memory", "Automatic"
For example:
@@ -165,24 +151,6 @@ You can also specify a percentage value:
.. literalinclude:: ../examples/Expression/tolerance_2
-.. _expr_filtering:
-
-Filtering
----------
-
-Enter an expression within square brackets to filter the dataset on a data
-frame:
-
-.. literalinclude:: ../examples/Expression/filter_1
-
-Note that this will only work when the underlying variable is a data frame,
-if it is not you will encounter an exception such as:
-
-.. code-block:: text
-
- Expression provided but container is not a data frame, it is "array"
-
-
.. _expr_functions:
Functions
@@ -193,8 +161,7 @@ Functions
max
~~~
-Return the max value in a set of values, if values are empty it will return
-NULL:
+Return the max value in a set of values:
.. literalinclude:: ../examples/Expression/func_max
@@ -212,8 +179,7 @@ Return the mean (i.e. average) value in a set of values:
min
~~~
-Return the min value in a set of values, if values are empty it will return
-NULL:
+Return the min value in a set of values:
.. literalinclude:: ../examples/Expression/func_min
@@ -281,8 +247,7 @@ Join values with a delimiter
first
~~~~~
-Return the first element in an array, if values are empty it will return
-NULL.
+Return the first element in an array, or throw an evaluation error.
.. literalinclude:: ../examples/Expression/first_1
@@ -300,58 +265,9 @@ Similar to :ref:`expr_display_as` but also allows specification of the "mode"
.. literalinclude:: ../examples/Expression/display_as_time_1
-time_unit
-~~~~~~~~~
-
-Normalize a time unit to either it's full name - `milliseconds` or its abbreviation `ms`
-
-.. literalinclude:: ../examples/Expression/time_unit_func_1
-
-time_convert
-~~~~~~~~~~~~
-
-Convert scale time value from one time unit to another.
-
-.. literalinclude:: ../examples/Expression/time_convert_1
-
-sum
-~~~
-
-Evaluate sum of given numbers
-
-.. literalinclude:: ../examples/Expression/sum_1
-
-count
-~~~~~
-
-Evaluate count of given numbers
-
-.. literalinclude:: ../examples/Expression/count_1
-
-frame
-~~~~~
-
-Create a new data frame with the given column names and row lists.
-
-.. literalinclude:: ../examples/Expression/frame_1
-
-contains
-~~~~~~~~
-
-Return true if value exists in given list
-
-.. literalinclude:: ../examples/Expression/contains_1
-
-if
-~~
-
-Provide one value if the given expression is true, else return the other value.
-Arguments are evaluated lazily.
-
-.. literalinclude:: ../examples/Expression/if_1
-
.. _KDE mode: https://en.wikipedia.org/wiki/Kernel_density_estimation
.. _standard deviation: https://en.wikipedia.org/wiki/Standard_deviation
.. _variance: https://en.wikipedia.org/wiki/Variance
.. _relative standard deviation: https://en.wikipedia.org/wiki/Coefficient_of_variation
.. _sprintf: https://www.php.net/manual/en/function.sprintf.php
+
diff --git a/docs/guides.rst b/docs/guides.rst
deleted file mode 100644
index 5b20e97c4..000000000
--- a/docs/guides.rst
+++ /dev/null
@@ -1,13 +0,0 @@
-Guides
-------
-
-.. toctree::
- :maxdepth: 2
-
- guides/assertions
- guides/benchmark-runner
- guides/regression-testing
- guides/ci-integration
- guides/reports
- guides/storage
- guides/writing-benchmarks
diff --git a/docs/guides/ci-integration.rst b/docs/guides/ci-integration.rst
deleted file mode 100644
index 07db3a2d2..000000000
--- a/docs/guides/ci-integration.rst
+++ /dev/null
@@ -1,48 +0,0 @@
-.. _ci_integration:
-
-Continuous Integration
-======================
-
-Automatically detecting performance regressions is a holy grail for
-benchmarking enthusiasts. Unfortunately your CI servers are almost certainly
-unstable environments which makes them unsuitable for picking up subtle changes
-in performance. You can, however, reliably detect major performance regressions
-and, if monitoring performance over time, identfy performance trends.
-
-The following methods are unofficial recommendations and, where applicable, you
-use them at your own risk.
-
-Github Actions Benchmarks
--------------------------
-
-The `github-action-benchmark`_ is a github action that uses github pages to
-store historical benchmarking results and builds a static page containing all the results.
-
-You'll need to generate a JSON document and you can do this via. a PHPBench report. Introduce the
-followng :ref:`report confguration`` in
-``phpbench.json``:
-
-.. literalinclude:: ../../examples/Benchmark/Hashing/github_action_benchmark.json
- :language: json
-
-You can now generate the JSON document required by the github action:
-
-.. code-block:: bash
-
- $ phpbench run --report=github-action-benchmark --output=json > output.json
-
-Now introduce the following `github workflow`_:
-
-.. literalinclude:: ../../.github/workflows/benchmark.yml
- :language: yaml
-
-In the above example we publish the results to the `benchmarks` sub-folder of
-the github pages site. The PHPBench report can be seen here:
-https://phpbench.github.io/phpbench/benchmarks/
-
-.. note::
-
- The above workflow only runs on the **main branch** and does not provide any feedback on pull requests. The github actin can also automatically comment on pull requests when regressions are detected. See the action's README file for more information.
-
-.. _github-action-benchmark: https://github.com/benchmark-action/github-action-benchmark
-.. _github workflow: https://docs.github.com/en/actions/concepts/workflows-and-actions/workflows
diff --git a/docs/images/barchart_aggregate.png b/docs/images/barchart_aggregate.png
deleted file mode 100644
index 15d9dd9b5..000000000
Binary files a/docs/images/barchart_aggregate.png and /dev/null differ
diff --git a/docs/images/example_config_linter.png b/docs/images/example_config_linter.png
deleted file mode 100644
index b19e2e353..000000000
Binary files a/docs/images/example_config_linter.png and /dev/null differ
diff --git a/docs/images/example_hashing.png b/docs/images/example_hashing.png
deleted file mode 100644
index de52b8a22..000000000
Binary files a/docs/images/example_hashing.png and /dev/null differ
diff --git a/docs/images/rstdev.png b/docs/images/rstdev.png
deleted file mode 100644
index 94eb0c670..000000000
Binary files a/docs/images/rstdev.png and /dev/null differ
diff --git a/docs/images/table_aggregate.png b/docs/images/table_aggregate.png
deleted file mode 100644
index da75a18cc..000000000
Binary files a/docs/images/table_aggregate.png and /dev/null differ
diff --git a/docs/index.rst b/docs/index.rst
index 776e5769e..fb4108426 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -19,13 +19,13 @@ Features include but are not limited to:
- :ref:`Iterations `: Sample your revolutions many times and review aggregated
statistical data.
- **Process Isolation**: Each iteration is executed in a separate process.
-- :doc:`Reporting `: Customizable reports and various output formats (e.g.
+- :doc:`Reporting `: Customizable reports and various output formats (e.g.
console, CSV, Markdown, HTML).
-- Report :doc:`guides/storage` and :ref:`comparison `: Store benchmarks locally to be used as a
+- Report :doc:`storage` and :ref:`comparison `: Store benchmarks locally to be used as a
:ref:`baseline ` reference, or to reference them later.
- **Memory Usage**: Keep an eye on the amount of memory used by benchmarking
subjects.
-- :doc:`Assertions `: Assert that code is performing within acceptable limits, or
+- :doc:`Assertions `: Assert that code is performing within acceptable limits, or
that it has not regressed from a previously recorded :ref:`baseline `.
.. _wall time: https://en.wikipedia.org/wiki/Elapsed_real_time
diff --git a/docs/installing.rst b/docs/installing.rst
index 138eddd54..563e5b056 100644
--- a/docs/installing.rst
+++ b/docs/installing.rst
@@ -9,7 +9,7 @@ Composer Install
To install PHPBench as a dependency of your project:
-.. code-block:: bash
+.. code-block:: php
$ composer require phpbench/phpbench --dev
@@ -20,39 +20,38 @@ You may then run PHPBench from your project's directory as follows:
$ ./vendor/bin/phpbench
-Install with PHIVE
-------------------
+Install as a PHAR package
+-------------------------
-Install with The PHAR Installation and Verification Environment `PHIVE `_:
+You can download the phar_ and the `public key`_, this can be done with CURL
+as follows:
.. code-block:: bash
- $ phive install phpbench
+ $ curl -o phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar
+ $ curl -o phpbench.phar.pubkey https://phpbench.github.io/phpbench/phpbench.phar.pubkey
-Install as a PHAR
------------------
-
-You can download `phpbench.phar` and the `phpbench.phar.asc`:
-as follows:
+You will probably then want make it executable and put it in your systems
+global path, on Linux systems:
.. code-block:: bash
- $ curl -Lo phpbench.phar https://github.com/phpbench/phpbench/releases/latest/download/phpbench.phar
- $ curl -Lo phpbench.phar.asc https://github.com/phpbench/phpbench/releases/latest/download/phpbench.phar.asc
+ $ chmod 0755 phpbench.phar
+ $ sudo mv phpbench.phar /usr/local/bin/phpbench
+ $ sudo mv phpbench.phar.pubkey /usr/local/bin/phpbench.pubkey
-The PHAR is signed. In order to verify that it was signed by the PHPBench team execute the
-following:
+You can update the version at any time by using the ``self-update`` command:
.. code-block:: bash
- gpg --recv-keys 1EF396F668895578CAB457A26FC579F5F0FCC966
- gpg --with-fingerprint --verify phpbench.phar.asc phpbench.phar
+ $ phpbench self-update
-You should then see something like the following:
+.. warning::
-.. code-block:: bash
+ Installing as a PHAR means that you are always updating to the latest
+ version, the latest version may include BC breaks. Therefore it is
+ recommended to include the package as a project dependency for
+ continuous-integration.
- gpg: Signature made Tue 13 Apr 2021 16:35:57 BST
- gpg: using RSA key 29BE1AD59988642ADCDFC86715E1F8E2B149E6F5
- gpg: Good signature from "Daniel Leech (PHPBench Github Key) " [ultimate]
- Primary key fingerprint: 29BE 1AD5 9988 642A DCDF C867 15E1 F8E2 B149 E6F5
+.. _phar: https://phpbench.github.io/phpbench/phpbench.phar
+.. _public key: https://phpbench.github.io/phpbench/phpbench.phar.pubkey
diff --git a/docs/quick-start.rst b/docs/quick-start.rst
index 5a3274c41..638f03f28 100644
--- a/docs/quick-start.rst
+++ b/docs/quick-start.rst
@@ -50,24 +50,6 @@ PHPBench should now be installed. Please create the following directories:
$ mkdir -p tests/Benchmark
$ mkdir src
-Before you start
-----------------
-
-You will need some code to benchmark, create the following class:
-
-.. code-block:: php
-
- // src/TimeConsumer.php
- namespace Acme;
-
- class TimeConsumer
- {
- public function consume()
- {
- usleep(100);
- }
- }
-
PHPBench configuration
----------------------
@@ -80,19 +62,9 @@ Create a ``phpbench.json`` file in the projects root directory:
.. code-block:: json
{
- "$schema":"./vendor/phpbench/phpbench/phpbench.schema.json",
"runner.bootstrap": "vendor/autoload.php"
}
-.. note::
-
- You can also run `phpbench config:init` to automatically create an
- **empty** config file, but you will need to manually set the
- `runner.bootstrap` option.
-
-Above we also added the optional ``$schema`` which should enable auto-completion and
-validation in your IDE.
-
.. note::
PHPBench does not **require** a bootstrap (or a configuration file for
@@ -105,29 +77,41 @@ validation in your IDE.
benchmark subjects and you may want to disable them, see :ref:`Disabling
the PHP INI file `.
-Create a Benchmark
-------------------
+Creating and running a benchmark
+--------------------------------
+
+You will need some code to benchmark, create a simple class in ``lib`` which
+consumes *time itself*:
+
+.. code-block:: php
+
+ namespace Acme;
+
+ class TimeConsumer
+ {
+ public function consume()
+ {
+ usleep(100);
+ }
+ }
+
In order to benchmark your code you will need to execute that code within
a method of a benchmarking class. By default the class name **must**
have the ``Bench`` suffix and each benchmark method must be prefixed
-with ``bench``.
-
-Create the following benchmark class:
+with ``bench``. Create the following class:
.. code-block:: php
// tests/Benchmark/TimeConsumerBench.php
- namespace Acme\Tests\Benchmark;
-
use Acme\TimeConsumer;
class TimeConsumerBench
{
public function benchConsume()
{
- $consumer = new TimeConsumer();
- $consumer->consume();
+ $consumer = new TimeConsumer();
+ $consumer->consume();
}
}
@@ -135,28 +119,27 @@ Now you can execute the benchmark as follows:
.. code-block:: bash
- $ ./vendor/bin/phpbench run tests/Benchmark --report=default
-
+ $ php vendor/bin/phpbench run tests/Benchmark/TimeConsumerBench.php --report=default
And you should see some output similar to the following:
.. code-block:: bash
- PHPBench @git_tag@ running benchmarks...
- with configuration file: /home/daniel/www/phpbench/phpbench-tutorial/phpbench.json
- with PHP version 7.4.14, xdebug ❌, opcache ❌
+ Running benchmarks.
- \Acme\Tests\Benchmark\TimeConsumerBench
+ \TimeConsumerBench
- benchConsume............................I0 - Mo185.000μs (±0.00%)
+ benchConsume I0 P0 [μ Mo]/r: 173.00μs [μSD μRSD]/r: 0.00μs 0.00%
- Subjects: 1, Assertions: 0, Failures: 0, Errors: 0
+ 1 subjects, 1 iterations, 1 revs, 0 rejects
+ ⅀T: 173μs μSD/r 0.00μs μRSD/r: 0.00%
+ min [mean mode] max: 173.00 [173.00 1732.00] 173.00 (μs/r)
- +------+--------------+--------------+-----+------+----------+-----------+--------------+----------------+
- | iter | benchmark | subject | set | revs | mem_peak | time_avg | comp_z_value | comp_deviation |
- +------+--------------+--------------+-----+------+----------+-----------+--------------+----------------+
- | 0 | benchConsume | benchConsume | 0 | 1 | 653,528b | 185.000μs | +0.00σ | +0.00% |
- +------+--------------+--------------+-----+------+----------+-----------+--------------+----------------+
+ +-------------------+---------------+-------+--------+------+------+-----+----------+------------+---------+-------+
+ | benchmark | subject | group | params | revs | iter | rej | mem | time | z-score | diff |
+ +-------------------+---------------+-------+--------+------+------+-----+----------+------------+---------+-------+
+ | TimeConsumerBench | benchConsume | | [] | 1 | 0 | 0 | 265,936b | 173.0000μs | 0.00σ | 1.00x |
+ +-------------------+---------------+-------+--------+------+------+-----+----------+------------+---------+-------+
The code was only executed once (as indicated by the ``revs`` column). To
achieve a better measurement increase the revolutions:
@@ -206,8 +189,7 @@ times.
.. note::
You can override the number of iterations and revolutions on the CLI using
- the ``--iterations`` and ``--revs`` options, or set them globally in the
- :ref:`configuration `.
+ the ``--iterations`` and ``--revs`` options.
At this point it would be better for you to use the :ref:`aggregate `
report rather than :ref:`default `:
@@ -219,15 +201,16 @@ report rather than :ref:`default `:
Increase Stability
------------------
-Stability can be inferred from `rstdev` (`relative standard deviation`_) , with 0% being the best and anything
-above 2% should be treated as suspicious.
+You will see the columns `stdev` and `rstdev`. `stdev` is the `standard deviation`_
+of the set of iterations and `rstdev` is `relative standard deviation`_.
-.. image:: images/rstdev.png
+Stability can be inferred from `rstdev`, with 0% being the best and anything
+about 2% should be treated as suspicious.
-To increase stability you can use the :ref:`@RetryThreshold
-` to automatically repeat the iterations until the
-`diff` (the percentage difference from the lowest measurement) fits within a
-given threshold:
+To increase stability you can use the ``--retry-threshold`` to automatically
+:ref:`repeat the iterations ` until the `diff` (the
+percentage difference from the lowest measurement) fits within a given
+threshold:
.. note::
@@ -251,10 +234,10 @@ PHPBench allows you to customize reports on the command line:
$ php vendor/bin/phpbench run tests/Benchmark/TimeConsumerBench.php --report='{"extends": "aggregate", "cols": ["subject", "mode"]}'
-Above we configure a new report which extends the :ref:`aggregate
-` report that we have already used, but we use only the
+Above we configure a new report which extends the :ref:`default
+` report that we have already used, but we use only the
``subject`` and ``mode`` columns. A full list of all the options for the
-default reports can be found in the :doc:`report-generators` reference.
+default reports can be found in the :doc:`report-generators` chapter.
Configuration
-------------
@@ -298,8 +281,8 @@ In this tutorial you learnt to
- Create a benchmarking class
- Use :ref:`revolutions ` and :ref:`iterations ` to more accurately profile your code
- Increase stability with the :ref:`retry threshold `
-- Use :doc:`reports `
-- Compare against previous benchmarks with :doc:`guides/regression-testing`
+- Use :doc:`reports `
.. _Composer: http://getcomposer.org
.. _relative standard deviation: https://en.wikipedia.org/wiki/Coefficient_of_variation
+.. _standard deviation: https://en.wikipedia.org/wiki/Standard_deviation
diff --git a/docs/reference.rst b/docs/reference.rst
index 5f1abe676..f6f014831 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -4,6 +4,7 @@ Reference
.. toctree::
:maxdepth: 2
+ assertions
annotributes
expression
configuration
@@ -11,4 +12,4 @@ Reference
executors
report-generators
report-renderers
- report-components
+ storage
diff --git a/docs/guides/regression-testing.rst b/docs/regression-testing.rst
similarity index 94%
rename from docs/guides/regression-testing.rst
rename to docs/regression-testing.rst
index 35dfdf280..b7fd15193 100644
--- a/docs/guides/regression-testing.rst
+++ b/docs/regression-testing.rst
@@ -16,7 +16,7 @@ Creating a baseline
The baseline is a tagged benchmark result. When creating a baseline we should
try and ensure it is as accurate as possible, it is therefore recommended to
-use a low value of :ref:`retry_threshold` and use a appropriate amount of
+use find a low value of :ref:`retry_threshold` and use a appropriate amount of
iterations (e.g. 10):
Run your benchmark on the code to which you want to compare:
@@ -45,7 +45,7 @@ Note that:
The final report should look something like:
-.. image:: ../images/baseline.png
+.. image:: images/baseline.png
The ``mean``, ``mode`` and ``rstdev`` columns show the percentage difference
from the previous run.
diff --git a/docs/report-components.rst b/docs/report-components.rst
deleted file mode 100644
index 64ed08cac..000000000
--- a/docs/report-components.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-Report Components
-=================
-
-Components are based on data frames are used with the
-:doc:`Component Generator `.
-
-.. toctree::
- :maxdepth: 1
- :glob:
-
- report-components/*
diff --git a/docs/report-components/barchart-aggregate.rst b/docs/report-components/barchart-aggregate.rst
deleted file mode 100644
index d7072cd0e..000000000
--- a/docs/report-components/barchart-aggregate.rst
+++ /dev/null
@@ -1,42 +0,0 @@
-Bar Chart Aggregate
-===================
-
-Render generate a bar chart from aggregated values
-
-.. figure:: ../images/barchart_aggregate.png
- :alt: HTML output
-
- HTML output
-
-Options
--------
-
-.. include:: options/_bar_chart_aggregate.rst
-
-Example
--------
-
-Given the following configuration:
-
-.. approved:: ../../examples/Command/report-component-barchart-aggregate
- :language: bash
- :section: 0
-
-When we run PHPBench with the configured report above:
-
-
-.. approved:: ../../examples/Command/report-component-barchart-aggregate
- :language: bash
- :section: 1
-
-Then it generates the following with the ``console`` renderer:
-
-.. approved:: ../../examples/Command/report-component-barchart-aggregate
- :language: bash
- :section: 2
-
-See Also
---------
-
-- :doc:`../../examples/hashing`: Example barchart comparing hashing
- algorithms.
diff --git a/docs/report-components/options/_bar_chart_aggregate.rst b/docs/report-components/options/_bar_chart_aggregate.rst
deleted file mode 100644
index 81e75d92d..000000000
--- a/docs/report-components/options/_bar_chart_aggregate.rst
+++ /dev/null
@@ -1,35 +0,0 @@
-
-**title**:
- Type(s): ``[string, null]``, Default: ``NULL``
-
- Title for the barchart
-
-**x_partition**:
- Type(s): ``[string, string[]]``, Default: ``[]``
-
- Partition the data for aggregation on the X axes. Partitions are made of rows sharing the same values in the expression or columns (which can be expressions) given here.
-
-**bar_partition**:
- Type(s): ``[string, string[]]``, Default: ``[]``
-
- Partition the individual bars for each X partition.
-
-**y_axes_label**:
- Type(s): ``string``, Default: ``yValue``
-
- Expression to evaluate the Y-Axis label. It is passed ``yValue`` (actual value of Y), ``partition`` (the set partition) and ``frame`` (the entire data frame)
-
-**x_axes_label**:
- Type(s): ``[null, string]``, Default: ``NULL``
-
- Expression to evaluate the X-Axis label, is passed ``xValue`` (default X value according to the X-partition), ``partition`` (the x-partition), and ``frame`` (the entire data frame)
-
-**y_error_margin**:
- Type(s): ``[string, null]``, Default: ``NULL``
-
- Expression to evaluate to determine the error margin to show on the chart. Leave as NULL to disable the error margin
-
-**y_expr**:
- Type(s): ``string``, Default: ``n/a``
-
- Expression to evaluate the Y-Axis value, e.g. ``mode(partition["result_time_avg"])``
\ No newline at end of file
diff --git a/docs/report-components/options/_section.rst b/docs/report-components/options/_section.rst
deleted file mode 100644
index 0c70f1d61..000000000
--- a/docs/report-components/options/_section.rst
+++ /dev/null
@@ -1,35 +0,0 @@
-
-**title**:
- Type(s): ``[string, null]``, Default: ``NULL``
-
- Title for generated report
-
-**description**:
- Type(s): ``[string, null]``, Default: ``NULL``
-
- Description for generated report
-
-**partition**:
- Type(s): ``string[]``, Default: ``[]``
-
- Partition the data using these column names - components will be rendered for each partition
-
-**filter**:
- Type(s): ``[string, null]``, Default: ``NULL``
-
- If provided, filter our rows which do not match this expression
-
-**components**:
- Type(s): ``array[]``, Default: ``[]``
-
- List of component configuration objects, each component must feature a ``component`` key (e.g. ``table_aggregate``)
-
-**tabbed**:
- Type(s): ``bool``, Default: ``false``
-
- Render components in tabs when supported in the output renderer (e.g. HTML)
-
-**tab_labels**:
- Type(s): ``string[]``, Default: ``[]``
-
- List of labels for tabs, will replace the default labels from left to right.
\ No newline at end of file
diff --git a/docs/report-components/options/_table_aggregate.rst b/docs/report-components/options/_table_aggregate.rst
deleted file mode 100644
index 221856b0e..000000000
--- a/docs/report-components/options/_table_aggregate.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-
-**title**:
- Type(s): ``[string, null]``, Default: ``NULL``
-
- Caption for the table
-
-**partition**:
- Type(s): ``[string, string[]]``, Default: ``[]``
-
- Partition the data using these column names - the row expressions will to aggregate the data in each partition
-
-**row**:
- Type(s): ``array``, Default: ``[]``
-
- Set of expressions used to evaluate the partitions, the key is the column name, the value is the expression
-
-**groups**:
- Type(s): ``array``, Default: ``[]``
-
- Group columns together, e.g. ``{"groups":{"group_name": {"cols": ["col1", "col2"]}}}``
\ No newline at end of file
diff --git a/docs/report-components/options/_text.rst b/docs/report-components/options/_text.rst
deleted file mode 100644
index ca3e42fff..000000000
--- a/docs/report-components/options/_text.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-
-**text**:
- Type(s): ``string``, Default: ``n/a``
\ No newline at end of file
diff --git a/docs/report-components/section.rst b/docs/report-components/section.rst
deleted file mode 100644
index 57723f2e3..000000000
--- a/docs/report-components/section.rst
+++ /dev/null
@@ -1,35 +0,0 @@
-Section
-=======
-
-The ``section`` component is identical to the
-:doc:`Component Generator <../report-generators/component>`.
-
-Use it to nest other components within a report and to partition the data
-frame.
-
-Options
--------
-
-.. include:: options/_section.rst
-
-Example
--------
-
-Given the following configuration:
-
-.. approved:: ../../examples/Command/report-component-section
- :language: bash
- :section: 0
-
-When we run PHPBench with the configured report above:
-
-
-.. approved:: ../../examples/Command/report-component-section
- :language: bash
- :section: 1
-
-Then it generates the following with the ``console`` renderer:
-
-.. approved:: ../../examples/Command/report-component-section
- :language: bash
- :section: 2
diff --git a/docs/report-components/table-aggregate.rst b/docs/report-components/table-aggregate.rst
deleted file mode 100644
index 20df57324..000000000
--- a/docs/report-components/table-aggregate.rst
+++ /dev/null
@@ -1,73 +0,0 @@
-Table Aggregate
-===============
-
-Render a table with aggregated data.
-
-.. figure:: ../images/table_aggregate.png
- :alt: HTML output
-
- HTML output
-
-Options
--------
-
-.. include:: options/_table_aggregate.rst
-
-Example
--------
-
-Given the following configuration:
-
-.. approved:: ../../examples/Command/report-component-table-aggregate
- :language: bash
- :section: 0
-
-When we run PHPBench with the configured report above:
-
-
-.. approved:: ../../examples/Command/report-component-table-aggregate
- :language: bash
- :section: 1
-
-Then it generates the following with the ``console`` renderer:
-
-.. approved:: ../../examples/Command/report-component-table-aggregate
- :language: bash
- :section: 2
-
-Advanced Columns
-----------------
-
-More advanced behavior can be accessed by passing an object instead
-of an expression, specifying a "column processor" ``type``.
-
-``expand``
-~~~~~~~~~~
-
-You can "expand" columns dynamically by further partitioning the data frame
-with the ``expand`` column processor:
-
-.. approved:: ../../examples/Command/report-component-table-aggregate-expand
- :language: bash
- :section: 0
-
-Above we:
-
-- Use an object as the value of the column definition ``by_iteration`` (the name
- is arbitrary and subsequently not used, it needs only to be unique)
-- Specified the ``type`` to be ``expand``
-- We group (partition) the data by ``iteration_index``)
-- Specify a set of columns
-
-Which would produce:
-
-.. approved:: ../../examples/Command/report-component-table-aggregate-expand
- :language: bash
- :section: 2
-
-Note that:
-
-- The ``partition`` parameter is used by default, overwriting the partition
- from the parent scope. You can rename this using the ``var`` option.
-- The ``key`` variable is made available representing the "key" of the
- partition, you can rename this variable with the ``key_var`` option.
diff --git a/docs/report-components/text.rst b/docs/report-components/text.rst
deleted file mode 100644
index 53fd10afc..000000000
--- a/docs/report-components/text.rst
+++ /dev/null
@@ -1,32 +0,0 @@
-Text
-====
-
-Render some text.
-
-Options
--------
-
-.. include:: options/_text.rst
-
-Example
--------
-
-Given the following configuration:
-
-.. approved:: ../../examples/Command/report-component-text
- :language: bash
- :section: 0
-
-When we run PHPBench with the configured report above:
-
-
-.. approved:: ../../examples/Command/report-component-text
- :language: bash
- :section: 1
-
-Then it generates the following with the ``console`` renderer:
-
-.. approved:: ../../examples/Command/report-component-text
- :language: bash
- :section: 2
-
diff --git a/docs/report-generators.rst b/docs/report-generators.rst
index 3758ab4df..2356e74a5 100644
--- a/docs/report-generators.rst
+++ b/docs/report-generators.rst
@@ -7,8 +7,6 @@ be rendered with :doc:`report renderers `.
.. toctree::
:maxdepth: 2
- report-generators/bare
+ report-generators/expression
report-generators/composite
- report-generators/component
report-generators/env
- report-generators/expression
diff --git a/docs/report-generators/bare.rst b/docs/report-generators/bare.rst
deleted file mode 100644
index 38f7d5839..000000000
--- a/docs/report-generators/bare.rst
+++ /dev/null
@@ -1,18 +0,0 @@
-.. _generator_bare:
-
-Bare
-====
-
-The bare report renders a table with all possible values from the data frame used by the expression and component report generators.
-
-This report can be useful for dumping a CSV with all values.
-
-.. code-block:: bash
-
- $ phpbench run --report=bare --output=csv
-
-Options
--------
-
-.. include:: options/_bare.rst
-
diff --git a/docs/report-generators/component.rst b/docs/report-generators/component.rst
deleted file mode 100644
index b6d0ffbbf..000000000
--- a/docs/report-generators/component.rst
+++ /dev/null
@@ -1,34 +0,0 @@
-.. _generator_component:
-
-Component
-=========
-
-The component generator creates a report that is comprised of different types of
-:doc:`components <../report-components>`.
-
-Options
--------
-
-.. include:: options/_component.rst
-
-Example
--------
-
-Given the following configuration:
-
-.. approved:: ../../examples/Command/report-generators-component
- :language: bash
- :section: 0
-
-When we run PHPBench with the configured report above:
-
-
-.. approved:: ../../examples/Command/report-generators-component
- :language: bash
- :section: 1
-
-Then it generates all reports:
-
-.. approved:: ../../examples/Command/report-generators-component
- :language: bash
- :section: 2
diff --git a/docs/report-generators/composite.rst b/docs/report-generators/composite.rst
index 1321f03a1..4d42617ac 100644
--- a/docs/report-generators/composite.rst
+++ b/docs/report-generators/composite.rst
@@ -3,29 +3,20 @@ Composite
This report generates multiple reports.
-Options
--------
-
-.. include:: options/_composite.rst
-
-Example
--------
-
-Given the following configuration:
-
.. approved:: ../../examples/Command/report-generators-composite
:language: bash
:section: 0
-When we run PHPBench with the configured report above:
+----------
.. approved:: ../../examples/Command/report-generators-composite
:language: bash
:section: 1
-Then it generates all reports:
+----------
.. approved:: ../../examples/Command/report-generators-composite
:language: bash
:section: 2
+
diff --git a/docs/report-generators/env.rst b/docs/report-generators/env.rst
index 40f36edc9..15cd21d97 100644
--- a/docs/report-generators/env.rst
+++ b/docs/report-generators/env.rst
@@ -6,8 +6,9 @@ Env
Generates a report showing the environmental metrics from when the benchmark
was executed.
-Options
--------
+Class: ``PhpBench\Report\Generator\EnvGenerator``.
-.. include:: options/_env.rst
+Options:
+- **title**: *(string)* Title of the report.
+- **description**: *(string)* Description of the report.
diff --git a/docs/report-generators/expression.rst b/docs/report-generators/expression.rst
index 97f5e7395..c5d2fe97e 100644
--- a/docs/report-generators/expression.rst
+++ b/docs/report-generators/expression.rst
@@ -3,10 +3,6 @@
Expression Report
=================
-.. note::
-
- For custom reports it is now recommended to use the :doc:`component` generator.
-
The expression generator is the generator that allows you to analyze your
benchmarking results. It uses the PHPBench :doc:`expression language
` to evaluate tabular data:
@@ -21,17 +17,24 @@ Yields something like:
:language: bash
:section: 2
-Options
--------
+Options:
-.. include:: options/_expression.rst
+- **title**: *(string)* Title of the report.
+- **description**: *(string)* Description of the report.
+- **cols**: *(array)* List of columns/expressions to show
+- **expressions**: *(array)* Set of available expressions
+- **baseline_expressions**: *(array)* Set of expressions that will be used
+ when a baseline is present
+- **break**: *(array)* List of columns; break into multiple tables based on
+- **aggregate**: *(array)* List of fields to aggregate on.
+- **include_baseline**: *(bool)* Include the baseline rows
.. _generator_expression_columns:
Columns
-------
-The visible columns are dictated by the ``cols`` configuration:
+The visible columns are dicated by the ``cols`` configuration:
.. approved:: ../../examples/Command/report-generators-column-visibility
:language: javascript
@@ -61,33 +64,12 @@ Which yields:
:language: bash
:section: 2
-.. _generator_expression_aggregate:
-
-Aggregate
----------
-
-Aggregation decides which values are included in each row - should each row
-contain only the values for a single iteration? should all values for the
-variant by included? should we include all values for the entire suite? (not
-recommended).
-
-.. approved:: ../../examples/Command/report-generators-aggregate
- :language: javascript
- :section: 0
-
-This will aggregate by unique values of the named columns, producing a single
-row per iteration:
-
-.. approved:: ../../examples/Command/report-generators-aggregate
- :language: bash
- :section: 2
-
.. _generator_expression_break:
Break
-----
-You can partition the report into multiple tables by using the ``break`` option:
+You can partition the report into mupltiple tables by using the ``break`` option:
.. approved:: ../../examples/Command/report-generators-break
:language: javascript
@@ -117,87 +99,10 @@ Which yields:
:language: bash
:section: 2
-
-.. _generator_expression_derivations:
-
-Derivations
------------
-
-:ref:`Expressions` effectively enable you to
-populate a *table* based on the benchmarking :ref:`data `.
-**Derivations** allow you to derive new columns from that table in one or more
-passes.
-
-Derivations have access to two variables and each expression is mapped on a row:
-
-- ``table``: a data frame containing the entire table. ``table['mean']`` for example will yield a **list** containing all of the values in the `mean` column.
-- ``row``: the current row to which the derivation will be mapped. ``row['mean']`` for example will yield the value of `mean` in the current row.
-
-In the following example we derive a new column ``super mean``:
-
-.. approved:: ../../examples/Command/report-generators-derivations
- :language: javascript
- :section: 0
-
-Which yields:
-
-.. approved:: ../../examples/Command/report-generators-derivations
- :language: bash
- :section: 2
-
-For example you add a **diff** column:
-
-.. approved:: ../../examples/Command/report-generators-column-diff
- :language: javascript
- :section: 0
-
-Which yields:
-
-.. approved:: ../../examples/Command/report-generators-column-diff
- :language: bash
- :section: 2
-
-.. _generator_expression_data:
-
Data
----
-The expressions have access to all :ref:`aggregated
-` data, and in addition, the
-entire result set via. the ``suite`` variable.
-
-The :ref:`Aggregated ` data is provided as an array
-of column names to values:
-
-.. code-block:: text
-
- {
- // ...
- "subject_name": ["benchFoobar", "benchFoobar", "benchFoobar"],
- "result_time_net": [10, 20, 30],
- // ...
- }
-
-So the ``mode`` for ``result_time_net`` could be calculated via the expression
-``mode(result_time_net)``.
-
-The ``suite`` variable is data frame that represents the entire result set and
-can be used to access a specific value through :ref:`filtering
-`. In the contrived example below we calculate the difference
-between the mode of a referenced subject against that of the current variant:
-
-.. approved:: ../../examples/Command/report-generators-filter-value
- :language: bash
- :section: 0
-
-Yielding:
-
-.. approved:: ../../examples/Command/report-generators-filter-value
- :language: bash
- :section: 2
-
-
-You can get a list of all available columns
+The expressions act on table data. You can get a list of all available columns
with:
.. approved:: ../../examples/Command/report-generators-data
@@ -210,6 +115,6 @@ Yielding:
:language: bash
:section: 2
-Note that any additional result and :doc:`environment <../environment>` data will
+Note that any additional result and :doc:`envronment <../environment>` data will
also be included in the form `result__` and
`env__`.
diff --git a/docs/report-generators/options/_bare.rst b/docs/report-generators/options/_bare.rst
deleted file mode 100644
index 89199fa09..000000000
--- a/docs/report-generators/options/_bare.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-
-**vertical**:
- Type(s): ``bool``, Default: ``false``
\ No newline at end of file
diff --git a/docs/report-generators/options/_component.rst b/docs/report-generators/options/_component.rst
deleted file mode 100644
index 0c70f1d61..000000000
--- a/docs/report-generators/options/_component.rst
+++ /dev/null
@@ -1,35 +0,0 @@
-
-**title**:
- Type(s): ``[string, null]``, Default: ``NULL``
-
- Title for generated report
-
-**description**:
- Type(s): ``[string, null]``, Default: ``NULL``
-
- Description for generated report
-
-**partition**:
- Type(s): ``string[]``, Default: ``[]``
-
- Partition the data using these column names - components will be rendered for each partition
-
-**filter**:
- Type(s): ``[string, null]``, Default: ``NULL``
-
- If provided, filter our rows which do not match this expression
-
-**components**:
- Type(s): ``array[]``, Default: ``[]``
-
- List of component configuration objects, each component must feature a ``component`` key (e.g. ``table_aggregate``)
-
-**tabbed**:
- Type(s): ``bool``, Default: ``false``
-
- Render components in tabs when supported in the output renderer (e.g. HTML)
-
-**tab_labels**:
- Type(s): ``string[]``, Default: ``[]``
-
- List of labels for tabs, will replace the default labels from left to right.
\ No newline at end of file
diff --git a/docs/report-generators/options/_composite.rst b/docs/report-generators/options/_composite.rst
deleted file mode 100644
index 0d01e7b78..000000000
--- a/docs/report-generators/options/_composite.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-
-**reports**:
- Type(s): ``array``, Default: ``n/a``
\ No newline at end of file
diff --git a/docs/report-generators/options/_env.rst b/docs/report-generators/options/_env.rst
deleted file mode 100644
index 693ef177c..000000000
--- a/docs/report-generators/options/_env.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-
-**title**:
- Type(s): ``[null, scalar]``, Default: ``NULL``
-
-**description**:
- Type(s): ``[null, scalar]``, Default: ``NULL``
\ No newline at end of file
diff --git a/docs/report-generators/options/_expression.rst b/docs/report-generators/options/_expression.rst
deleted file mode 100644
index 24e5159e9..000000000
--- a/docs/report-generators/options/_expression.rst
+++ /dev/null
@@ -1,40 +0,0 @@
-
-**title**:
- Type(s): ``[null, string]``, Default: ``NULL``
-
- Title to use for report
-
-**description**:
- Type(s): ``[null, string]``, Default: ``NULL``
-
- Description to use for report
-
-**cols**:
- Type(s): ``[array, null]``, Default: ``NULL``
-
- Columns to display
-
-**expressions**:
- Type(s): ``array``, Default: ``[]``
-
- Map from column names to expressions
-
-**baseline_expressions**:
- Type(s): ``array``, Default: ``[]``
-
- When the baseline is used, expressions here will be merged with the ``expressions``.
-
-**aggregate**:
- Type(s): ``array``, Default: ``[suite_tag, benchmark_class, subject_name, variant_index]``
-
- Group rows by these columns
-
-**break**:
- Type(s): ``array``, Default: ``[]``
-
- Group tables by these columns
-
-**include_baseline**:
- Type(s): ``bool``, Default: ``false``
-
- If the baseline should be included as additional rows, or if it should be inlined
\ No newline at end of file
diff --git a/docs/report-renderers.rst b/docs/report-renderers.rst
index d5dc9cb50..c4412476f 100644
--- a/docs/report-renderers.rst
+++ b/docs/report-renderers.rst
@@ -15,9 +15,17 @@ on the CLI. The renderer may also supply default outputs.
Renders directly to the console.
+Class: ``PhpBench\Report\Renderer\ConsoleRenderer``.
+
Options:
-.. include:: ./report-renderers/options/_console.rst
+- **table_style**: *(string)* Table style to use, one of: ``default``,
+ ``compact``, ``borderless`` or ``symfony-style-guide``.
+
+Default outputs:
+
+- ``console``: Renderers the report directly to the console. This is the
+ **default** output method.
``delimited``
-------------
@@ -26,43 +34,29 @@ The delimited renderer outputs the report as a delimited value list (for
example a tab separated list of values). Such data can be easily imported into
applications such as GNUPlot_.
+Class: ``PhpBench\Report\Renderer\DelimitedRenderer``.
Options:
-.. include:: ./report-renderers/options/_delimited.rst
+- **delimiter**: *(string)*: Path to the output file (existing files will be
+ overwritten).
+- **header**: *(boolean)*: If a header should be included in the output.
+Default outputs:
-``json``
---------
+- ``delimiter``: The delimiter to use.
-Outputs reports (or rather the _tables_ in reports) as JSON records.
+``debug``
+---------
-``html``
------------
-
-Render the report to a HTML document.
+Output the raw XML of the report document. Useful for debugging.
Options:
-.. include:: ./report-renderers/options/_html.rst
+**none**
-.. _GNUPlot: http://www.gnuplot.info/
+Default outputs:
-Given the following configuration:
+- ``debug``: Outputs the report document's XML.
-.. approved:: ../examples/Command/report-output-html
- :language: bash
- :section: 0
-
-When we run PHPBench with the configured report above:
-
-.. approved:: ../examples/Command/report-output-html
- :language: bash
- :section: 1
-
-Then it will generate a HTML report to the configured path with the given
-title:
-
-.. approved:: ../examples/Command/report-output-html
- :language: bash
- :section: 2
+.. _GNUPlot: http://www.gnuplot.info/
diff --git a/docs/report-renderers/options/_console.rst b/docs/report-renderers/options/_console.rst
deleted file mode 100644
index fcd475c75..000000000
--- a/docs/report-renderers/options/_console.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-
-**table_style**:
- Type(s): ``[null, scalar]``, Default: ``NULL``
-
- This is option does nothing and will be removed in PHPBench 2.0
\ No newline at end of file
diff --git a/docs/report-renderers/options/_delimited.rst b/docs/report-renderers/options/_delimited.rst
deleted file mode 100644
index c594d6b0a..000000000
--- a/docs/report-renderers/options/_delimited.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-
-**delimiter**:
- Type(s): ``string``, Default: `` ``
-
-**file**:
- Type(s): ``[null, string]``, Default: ``NULL``
-
-**header**:
- Type(s): ``bool``, Default: ``true``
\ No newline at end of file
diff --git a/docs/report-renderers/options/_html.rst b/docs/report-renderers/options/_html.rst
deleted file mode 100644
index 56478568f..000000000
--- a/docs/report-renderers/options/_html.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-
-**title**:
- Type(s): ``string``, Default: ``PHPBench Report``
-
- Title of document
-
-**path**:
- Type(s): ``string``, Default: ``.phpbench/html/index.html``
-
- Path to output document
\ No newline at end of file
diff --git a/docs/guides/reports.rst b/docs/reports.rst
similarity index 51%
rename from docs/guides/reports.rst
rename to docs/reports.rst
index 7f90176c7..eefebcf64 100644
--- a/docs/guides/reports.rst
+++ b/docs/reports.rst
@@ -2,11 +2,11 @@ Reports
=======
PHPBench includes a reporting framework. :doc:`Report
-generators <../report-generators>` provide report data which can subsequently be
+generators ` provide report data which can subsequently be
rendered by :doc:`report renderer
-<../report-renderers>` (e.g. ``console`` or ``html``).
+`.
-This guide will deal with generating reports and assume that the ``console``
+This chapter will deal with generating reports and assume that the ``console``
renderer is used.
Generating Reports
@@ -14,19 +14,20 @@ Generating Reports
To report after a benchmarking run:
-.. approved:: ../../examples/Command/run-reports-aggregate
+.. approved:: ../examples/Command/run-reports-aggregate
:language: bash
:section: 1
Multiple reports can be specified:
-.. approved:: ../../examples/Command/run-reports-aggregate-and-env
+.. approved:: ../examples/Command/run-reports-aggregate-and-env
:language: bash
:section: 1
-You can also tag runs and generate reports afterwards:
+The report command operates in a similar way but requires you to provide some
+data, either from XML dumps or by using a :doc:`storage ` UUID or tag:
-.. approved:: ../../examples/Command/report-ref-latest-and-aggregate
+.. approved:: ../examples/Command/report-ref-latest-and-aggregate
:language: bash
:section: 1
@@ -41,29 +42,29 @@ JSON encoded string instead of the report name:
To configure a report in ``phpbench.json``:
-.. approved:: ../../examples/Command/run-configuring-reports-phpbenchjson
+.. approved:: ../examples/Command/run-configuring-reports-phpbenchjson
:language: javascript
:section: 0
Then run it with:
-.. approved:: ../../examples/Command/run-configuring-reports-phpbenchjson
+.. approved:: ../examples/Command/run-configuring-reports-phpbenchjson
:language: bash
:section: 1
You can also configure reports directly from the command line using simplified
JSON:
-.. approved:: ../../examples/Command/run-configuring-reports
+.. approved:: ../examples/Command/run-configuring-reports
:language: bash
:section: 1
In each case it is required to specify the ``generator`` key which corresponds
-to the registered name of the :doc:`report generator <../report-generators>`.
+to the registered name of the :doc:`report generator `.
You may also **extend** an existing report configuration:
-.. approved:: ../../examples/Command/run-configuring-reports-extend
+.. approved:: ../examples/Command/run-configuring-reports-extend
:language: bash
:section: 1
@@ -77,43 +78,14 @@ Default Reports
``aggregate``
~~~~~~~~~~~~~
-Shows aggregate details of each set of iterations.
+Shows aggregate details of each set of iterations:
-Run:
-
-.. approved:: ../../examples/Command/run-reports-aggregate
- :language: bash
- :section: 1
-
-And get something like:
-
-.. approved:: ../../examples/Command/run-reports-aggregate
+.. approved:: ../examples/Command/run-reports-aggregate
:language: bash
:section: 2
It is uses the ``table`` generator, see :ref:`generator_expression` for more information.
-.. _report_benchmark:
-
-``benchmark``
-~~~~~~~~~~~~~
-
-Sumarize each benchmark:
-
-
-Run:
-
-.. approved:: ../../examples/Command/run-reports-benchmark
- :language: bash
- :section: 1
-
-And get something like:
-
-.. approved:: ../../examples/Command/run-reports-benchmark
- :language: bash
- :section: 2
-
-
.. _report_default:
``default``
@@ -121,17 +93,9 @@ And get something like:
The default report presents the result of *each iteration*:
-Run:
-
-.. approved:: ../../examples/Command/run-reports-default
+.. approved:: ../examples/Command/report-generators-composite
:language: javascript
- :section: 1
-
-And get something like:
-
-.. approved:: ../../examples/Command/run-reports-default
- :language: javascript
- :section: 2
+ :section: 0
It is uses the ``table`` generator, see :ref:`generator_expression` for more information.
@@ -143,15 +107,7 @@ It is uses the ``table`` generator, see :ref:`generator_expression` for more inf
This report shows information about the environment that the benchmarks were
executed in.
-Run:
-
-.. approved:: ../../examples/Command/run-reports-env
- :language: bash
- :section: 1
-
-And get something like:
-
-.. approved:: ../../examples/Command/run-reports-env
+.. approved:: ../examples/Command/run-reports-env
:language: bash
:section: 2
@@ -164,32 +120,13 @@ Columns:
- **key**: Information key.
- **value**: Information value.
-See the :doc:`../environment` reference for more information.
+See the :doc:`environment` chapter for more information.
.. note::
The information available will differ depending on platform. For example,
- ``unix-sysload`` is only available on UNIX platforms, where
+ ``unit-sysload`` is unsurprisingly only available on UNIX platforms, where
as the VCS field will appear only when a *supported* VCS system is being
used.
.. _aggregate report: https://github.com/phpbench/phpbench/blob/master/lib/Extension/config/report/generators.php
-
-.. _report_overview:
-
-``overview``
-~~~~~~~~~~~~~
-
-Shows overview of a single or mutiple runs:
-
-Run:
-
-.. approved:: ../../examples/Command/run-reports-overview
- :language: bash
- :section: 1
-
-And get something like:
-
-.. approved:: ../../examples/Command/run-reports-overview
- :language: bash
- :section: 2
diff --git a/docs/requirements.txt b/docs/requirements.txt
index cc9f53322..29a6ed30d 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,5 +1,5 @@
-docutils==0.18.1
-Pygments==2.15.0
-sphinx==7.0.0
+docutils==0.13.1
+Pygments==2.7.4
+sphinx==1.8.5
git+https://github.com/fabpot/sphinx-php.git@v2.0.0#egg_name=sphinx-php
-sphinx-tabs==3.4.7
+sphinx-tabs==1.1.13
diff --git a/docs/guides/storage.rst b/docs/storage.rst
similarity index 100%
rename from docs/guides/storage.rst
rename to docs/storage.rst
diff --git a/docs/guides/writing-benchmarks.rst b/docs/writing-benchmarks.rst
similarity index 94%
rename from docs/guides/writing-benchmarks.rst
rename to docs/writing-benchmarks.rst
index 480035c9e..3bb37ea21 100644
--- a/docs/guides/writing-benchmarks.rst
+++ b/docs/writing-benchmarks.rst
@@ -57,5 +57,5 @@ placed in the class docblock, or on individual methods docblocks.
Benchmark Configuration
-----------------------
-See the :doc:`Annotations and Attributes<../annotributes>` reference to see how
+See the :doc:`Annotations and Attributes` reference to see how
you can configure your benchmarks.
diff --git a/examples/Annotations/AnnotatedBench.php b/examples/Annotations/AnnotatedBench.php
index cc201bb28..5d8172aab 100644
--- a/examples/Annotations/AnnotatedBench.php
+++ b/examples/Annotations/AnnotatedBench.php
@@ -54,7 +54,7 @@ class AnnotatedBench
* @Assert("mode(variant.time.avg) < 200 ms")
// endsection: assert
// section: format
- * @Format("mode(variant.time.avg) as ms ~ 'Hello World'")
+ * @Format("mode(variant.time.avg) as ms ~ \" Hello World\"")
// endsection: format
// section: executor
* @Executor("local")
@@ -88,7 +88,7 @@ public function benchThisWillBeSkipped()
*/
public function benchMd5(array $params): void
{
- hash('md5', (string) $params['string']);
+ hash('md5', $params['string']);
}
public function provideMd5(): Generator
@@ -153,7 +153,7 @@ public function provideStringsAsArray(): array
*/
public function benchHash($params)
{
- hash((string) $params['algorithm'], (string) $params['string']);
+ hash($params['algorithm'], $params['string']);
}
public function provideStrings()
@@ -167,7 +167,7 @@ public function provideNumbers()
yield 'md5' => [ 'algorithm' => 'md5' ];
yield 'sha1' => [ 'algorithm' => 'sha1' ];
}
-
+
// endsection: paramMultiple
// section: all
}
diff --git a/examples/Attributes/AttributedBench.php b/examples/Attributes/AttriutedBench.php
similarity index 96%
rename from examples/Attributes/AttributedBench.php
rename to examples/Attributes/AttriutedBench.php
index 2c5184773..e9ad11937 100644
--- a/examples/Attributes/AttributedBench.php
+++ b/examples/Attributes/AttriutedBench.php
@@ -14,7 +14,7 @@
#[Bench\AfterClassMethodsClassMethods(['tearDownBeforeClass'])]
// endsection: afterClassMethods
// section: all
-class AttributedBench
+class AttriutedBench
{
// endsection: all
// section: benchTime
@@ -80,7 +80,7 @@ public function benchThisWillBeSkipped()
#[Bench\ParamProviders(['provideMd5'])]
public function benchMd5(array $params): void
{
- hash('md5', (string) $params['string']);
+ hash('md5', $params['string']);
}
public function provideMd5(): Generator
@@ -141,7 +141,7 @@ public function provideStringsAsArray(): array
#[Bench\ParamProviders(['provideStrings', 'provideNumbers'])]
public function benchHash(array $params)
{
- hash((string) $params['algorithm'], (string) $params['string']);
+ hash($params['algorithm'], $params['string']);
}
public function provideStrings()
@@ -155,7 +155,7 @@ public function provideNumbers()
yield 'md5' => [ 'algorithm' => 'md5' ];
yield 'sha1' => [ 'algorithm' => 'sha1' ];
}
-
+
// endsection: paramMultiple
// section: all
}
diff --git a/examples/Benchmark/ConfigLinters/JsonDecodeLinterBench.php b/examples/Benchmark/ConfigLinters/JsonDecodeLinterBench.php
deleted file mode 100644
index 886eefe21..000000000
--- a/examples/Benchmark/ConfigLinters/JsonDecodeLinterBench.php
+++ /dev/null
@@ -1,15 +0,0 @@
-linter = $this->createLinter();
- }
-
- public abstract function createLinter(): ConfigLinter;
-
- /**
- * @ParamProviders({"provideScale"})
- * @BeforeMethods({"setUpJsonString"})
- */
- public function benchLint(): void
- {
- $this->linter->lint('path/to.json', $this->json);
- }
-
- public function setUpJsonString(array $params): void
- {
- $data = self::buildData($params[0]);
- $this->json = json_encode($data, JSON_PRETTY_PRINT);
- }
-
- public function provideScale(): Generator
- {
- yield [1];
- yield [2];
- yield [3];
- }
-
- public static function buildData(int $size): array
- {
- $data = [];
- for ($i = 0; $i < $size; $i++) {
- if ($size - 1 === 0) {
- $data['key-' . $i] = 'test';
- break;
- }
- $data['key-' . $i] = self::buildData($size - 1);
- }
-
- return $data;
- }
-}
-// endsection: all
diff --git a/examples/Benchmark/ConfigLinters/NoOpLinter.php b/examples/Benchmark/ConfigLinters/NoOpLinter.php
deleted file mode 100644
index 25d43d50b..000000000
--- a/examples/Benchmark/ConfigLinters/NoOpLinter.php
+++ /dev/null
@@ -1,15 +0,0 @@
- [
- 'text' => file_get_contents($path)
- ];
- }
- }
-}
-// endsection: all
diff --git a/examples/Benchmark/Hashing/HashingBench.php b/examples/Benchmark/Hashing/HashingBench.php
deleted file mode 100644
index 5ae2e8cf6..000000000
--- a/examples/Benchmark/Hashing/HashingBench.php
+++ /dev/null
@@ -1,57 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- *
- */
-
-namespace PhpBench\Examples\Benchmark;
-
-// section: all
-/**
- * @BeforeMethods("setUp")
- */
-class HashingBench
-{
- private string $string = '';
-
- public function setUp(array $params): void
- {
- $this->string = str_repeat('X', $params['size']);
- }
-
- /**
- * @ParamProviders({
- * "provideAlgos",
- * "provideStringSize"
- * })
- */
- public function benchAlgos($params): void
- {
- hash((string) $params['algo'], $this->string);
- }
-
- public function provideAlgos()
- {
- foreach (array_slice(\hash_algos(), 0, 20) as $algo) {
- if ($algo === 'md2') { // md2 is in a different performance category
- continue;
- }
- yield ['algo' => $algo];
- }
-
- }
-
- public function provideStringSize() {
- yield ['size' => 10];
- yield ['size' => 100];
- yield ['size' => 1000];
- }
-
-}
-// endsection: all
diff --git a/examples/Benchmark/Hashing/github_action_benchmark.json b/examples/Benchmark/Hashing/github_action_benchmark.json
deleted file mode 100644
index 3746f2670..000000000
--- a/examples/Benchmark/Hashing/github_action_benchmark.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "report.generators": {
- "github-action-benchmark": {
- "title": "github-action-benchmark",
- "description": "https://github.com/benchmark-action/github-action-benchmark",
- "cols": [
- "name",
- "unit",
- "value",
- "range",
- "extra"
- ],
- "expressions": {
- "name": "format('%s::%s%s', first(benchmark_name),first(subject_name),if(first(variant_name) != false, format(' (%s)', first(variant_name)), ''))",
- "unit": "time_unit(first(subject_time_unit), true)",
- "value": "time_convert(mode(result_time_avg), null, time_unit(first(subject_time_unit)))",
- "range": "format('± %.2f%%', rstdev(result_time_avg))",
- "extra": "format('%d iterations, %d revs', first(variant_iterations), first(variant_revs))"
- },
- "aggregate": [
- "suite_tag",
- "benchmark_class",
- "subject_name",
- "variant_index"
- ],
- "generator": "expression"
- }
- }
-}
-
diff --git a/examples/Benchmark/Hashing/hashing_report.json b/examples/Benchmark/Hashing/hashing_report.json
deleted file mode 100644
index 6e302ab20..000000000
--- a/examples/Benchmark/Hashing/hashing_report.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "report.generators": {
- "hashing": {
- "title": "Hashing algorithm comparison",
- "description": "Compares algorithms for different string sizes",
- "generator": "component",
- "filter": "benchmark_name = 'HashingBench'",
- "components": [
- {
- "component": "bar_chart_aggregate",
- "x_partition": "'Size: ' ~ variant_params['size']",
- "bar_partition": "variant_params['algo']",
- "y_expr": "mode(partition['result_time_avg']) as time",
- "y_axes_label": "yValue as time"
- }
- ]
- }
- }
-}
diff --git a/examples/Benchmark/Macro/BaseBenchCase.php b/examples/Benchmark/Macro/BaseBenchCase.php
index 8374cc746..98746033b 100644
--- a/examples/Benchmark/Macro/BaseBenchCase.php
+++ b/examples/Benchmark/Macro/BaseBenchCase.php
@@ -12,7 +12,6 @@
namespace PhpBench\Examples\Benchmark\Macro;
-use RuntimeException;
use PhpBench\DependencyInjection\Container;
use PhpBench\Extension\ConsoleExtension;
use PhpBench\Extension\CoreExtension;
@@ -39,7 +38,7 @@ class BaseBenchCase
{
private $container;
- private array $extensions = [
+ private $extensions = [
CoreExtension::class,
RunnerExtension::class,
ReportExtension::class,
@@ -48,7 +47,7 @@ class BaseBenchCase
ConsoleExtension::class,
];
- private array $config = [];
+ private $config = [];
/**
* The constructor can be used as a quick way to setup the
@@ -97,11 +96,13 @@ public function runCommand($serviceId, $args)
{
$input = new ArrayInput($args);
$output = new BufferedOutput();
- $command = $this->getContainer()->get($serviceId);
+ $command = $this->getContainer([
+ CoreExtension::PARAM_WORKING_DIR => $this->workspace()->path()
+ ])->get($serviceId);
$exitCode = $command->run($input, $output);
if ($exitCode !== 0) {
- throw new RuntimeException(sprintf(
+ throw new \RuntimeException(sprintf(
'Got non-zero exit code when executing command "%s"',
$serviceId
));
diff --git a/examples/Benchmark/Macro/LogBench.php b/examples/Benchmark/Macro/LogBench.php
index 282817993..e82fa974d 100644
--- a/examples/Benchmark/Macro/LogBench.php
+++ b/examples/Benchmark/Macro/LogBench.php
@@ -42,7 +42,6 @@ public function benchLog()
{
$this->runCommand(LogCommand::class, [
'--no-pagination' => true,
- '--limit' => 1
]);
}
}
diff --git a/examples/Benchmark/Micro/ComplexParameterBench.php b/examples/Benchmark/Micro/ComplexParameterBench.php
deleted file mode 100644
index a83cc0f8b..000000000
--- a/examples/Benchmark/Micro/ComplexParameterBench.php
+++ /dev/null
@@ -1,27 +0,0 @@
- "\x80"
- ],
- [
- 'param' => new DateTime()
- ]
- ];
- }
-}
diff --git a/examples/Benchmark/Micro/DependencyInjection/ContainerBench.php b/examples/Benchmark/Micro/DependencyInjection/ContainerBench.php
index 2d6be803c..06cd0425e 100644
--- a/examples/Benchmark/Micro/DependencyInjection/ContainerBench.php
+++ b/examples/Benchmark/Micro/DependencyInjection/ContainerBench.php
@@ -12,7 +12,6 @@
namespace PhpBench\Examples\Benchmark\Micro\DependencyInjection;
-use PhpBench\Extension\CoreExtension;
use PhpBench\DependencyInjection\Container;
/**
@@ -31,7 +30,7 @@ public function benchInitNoExtensions()
public function benchInitCoreExtension()
{
$container = new Container([
- CoreExtension::class,
+ 'PhpBench\Extension\CoreExtension',
]);
$container->init();
}
diff --git a/examples/Benchmark/Micro/HashingBench.php b/examples/Benchmark/Micro/HashingBench.php
new file mode 100644
index 000000000..17634d39b
--- /dev/null
+++ b/examples/Benchmark/Micro/HashingBench.php
@@ -0,0 +1,36 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ */
+
+namespace PhpBench\Examples\Benchmark\Micro;
+
+function hash_algos()
+{
+ yield ['algo' => 'md5'];
+
+ yield ['algo' => 'sha256'];
+}
+
+/**
+ * @Revs(1000)
+ * @Iterations(10)
+ */
+class HashingBench
+{
+ /**
+ * @Assert("mode(variant.time.avg) < 1ms")
+ * @ParamProviders({"\PhpBench\Examples\Benchmark\Micro\hash_algos"})
+ */
+ public function benchAlgos($params)
+ {
+ return hash($params['algo'], 'Hello World');
+ }
+}
diff --git a/examples/Benchmark/Micro/Math/KdeBench.php b/examples/Benchmark/Micro/Math/KdeBench.php
index c7a0802ec..2426f3bb1 100644
--- a/examples/Benchmark/Micro/Math/KdeBench.php
+++ b/examples/Benchmark/Micro/Math/KdeBench.php
@@ -24,7 +24,7 @@
*/
class KdeBench
{
- private array $points = [];
+ private $points = [];
public function generatePoints($params)
{
diff --git a/examples/Command/report-component-barchart-aggregate b/examples/Command/report-component-barchart-aggregate
deleted file mode 100644
index b0508e437..000000000
--- a/examples/Command/report-component-barchart-aggregate
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "runner.path": "NothingBench.php",
- "runner.executor": "debug-example",
- "runner.iterations": 20,
- "runner.executors": {
- "debug-example": {
- "executor": "debug",
- "times":[10, 20, 30, 40, 50]
- }
- },
- "runner.env_enabled_providers": ["test"],
- "report.generators": {
- "chart": {
- "generator": "component",
- "components": [
- {
- "component": "bar_chart_aggregate",
- "title": "Example Bar Chart",
- "x_partition": ["iteration_index"],
- "bar_partition": ["suite_tag"],
- "y_expr": "mode(partition['result_time_avg'])",
- "y_axes_label": "yValue as time precision 1"
- }
- ]
- }
- }
-}
----
-phpbench run --report=chart
----
-Example Bar Chart
-
-50.0μs │ █ █ █ █
-43.8μs │ ▄ █ ▄ █ ▄ █ ▄ █
-37.5μs │ █ █ █ █ █ █ █ █
-31.3μs │ ▇ █ █ ▇ █ █ ▇ █ █ ▇ █ █
-25.0μs │ ▂ █ █ █ ▂ █ █ █ ▂ █ █ █ ▂ █ █ █
-18.8μs │ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █
-12.5μs │ ▅ █ █ █ █ ▅ █ █ █ █ ▅ █ █ █ █ ▅ █ █ █ █
-6.3μs │ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █
- └─────────────────────────────────────────
- 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
-
-[█ ]
-
-1: 0 2: 1 3: 2 4: 3
-5: 4 6: 5 7: 6 8: 7
-9: 8 10: 9 11: 10 12: 11
-13: 12 14: 13 15: 14 16: 15
-17: 16 18: 17 19: 18 20: 19
-
-
diff --git a/examples/Command/report-component-section b/examples/Command/report-component-section
deleted file mode 100644
index 43b8dab0f..000000000
--- a/examples/Command/report-component-section
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "runner.path": "NothingBench.php",
- "runner.executor": "debug",
- "runner.env_enabled_providers": ["test"],
- "report.generators": {
- "nested": {
- "generator": "component",
- "title": "Outer Section",
- "components": [
- {
- "component": "section",
- "title": "Inner Section",
- "components": [
- {
- "component": "text",
- "text": "Hello World"
- }
- ]
- }
- ]
- }
- }
-}
----
-phpbench run --report=nested
----
-Outer Section
-=============
-
-Inner Section
-=============
-
-Hello World
diff --git a/examples/Command/report-component-table-aggregate b/examples/Command/report-component-table-aggregate
deleted file mode 100644
index 6c572a28c..000000000
--- a/examples/Command/report-component-table-aggregate
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "runner.path": "NothingBench.php",
- "runner.executor": "debug",
- "runner.env_enabled_providers": ["test"],
- "report.generators": {
- "nested": {
- "generator": "component",
- "title": "My Aggregated Table",
- "components": [
- {
- "component": "table_aggregate",
- "title": "Table",
- "row": {
- "benchmark": "first(partition['benchmark_name'])",
- "net_time": "sum(partition['result_time_net'])"
- }
- }
- ]
- }
- }
-}
----
-phpbench run --report=nested
----
-My Aggregated Table
-===================
-
-Table
-+--------------+----------+
-| benchmark | net_time |
-+--------------+----------+
-| NothingBench | 10 |
-+--------------+----------+
-
diff --git a/examples/Command/report-component-table-aggregate-expand b/examples/Command/report-component-table-aggregate-expand
deleted file mode 100644
index 96e642f72..000000000
--- a/examples/Command/report-component-table-aggregate-expand
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "runner.path": "MultipleSubjects.php",
- "runner.executor": "debug-example",
- "runner.iterations": 5,
- "runner.executors": {
- "debug-example": {
- "executor": "debug",
- "times":[10, 20, 30, 40, 50],
- "spread": [4, 5, 2, 3]
- }
- },
- "runner.env_enabled_providers": ["test"],
- "report.generators": {
- "expanded": {
- "generator": "component",
- "components": [
- {
- "component": "table_aggregate",
- "title": "Table with rows per iteration",
- "partition": "subject_name",
- "row": {
- "benchmark": "first(partition['subject_name'])",
- "by_iteration": {
- "type": "expand",
- "partition": ["iteration_index"],
- "cols": {
- "Iteration #{{ key }}": "mode(partition['result_time_avg'])"
- }
- }
- }
- }
- ]
- }
- }
-}
----
-phpbench run --report=expanded
----
-Table with rows per iteration
-+---------------+--------------+--------------+--------------+--------------+--------------+
-| benchmark | Iteration #0 | Iteration #1 | Iteration #2 | Iteration #3 | Iteration #4 |
-+---------------+--------------+--------------+--------------+--------------+--------------+
-| benchSubject1 | 14 | 25 | 32 | 43 | 54 |
-| benchSubject2 | 14 | 25 | 32 | 43 | 54 |
-| benchSubject3 | 14 | 25 | 32 | 43 | 54 |
-+---------------+--------------+--------------+--------------+--------------+--------------+
-
diff --git a/examples/Command/report-component-text b/examples/Command/report-component-text
deleted file mode 100644
index fc339078e..000000000
--- a/examples/Command/report-component-text
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "runner.path": "NothingBench.php",
- "runner.executor": "debug",
- "runner.env_enabled_providers": ["test"],
- "report.generators": {
- "text": {
- "generator": "component",
- "components": [
- {
- "component": "text",
- "text": "Hello World"
- }
- ]
- }
- }
-}
----
-phpbench run --report=text
----
-Hello World
diff --git a/examples/Command/report-generators-aggregate b/examples/Command/report-generators-aggregate
deleted file mode 100644
index cdc4837ed..000000000
--- a/examples/Command/report-generators-aggregate
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "report.generators": {
- "my-report": {
- "generator": "expression",
- "aggregate": ["benchmark_class", "subject_name", "variant_name", "iteration_index"]
- }
- }
-}
----
-phpbench run --report=my-report --executor=debug NothingBench.php --progress=none --iterations=5
----
-+-----------+--------------+--------------+-----+------+-----+----------+----------+----------+----------+----------+---------+--------+
-| tag | benchmark | subject | set | revs | its | mem_peak | best | mode | mean | worst | stdev | rstdev |
-+-----------+--------------+--------------+-----+------+-----+----------+----------+----------+----------+----------+---------+--------+
-| | NothingBench | benchNothing | | 1 | 5 | 100b | 10.000μs | 10.000μs | 10.000μs | 10.000μs | 0.000μs | ±0.00% |
-| | NothingBench | benchNothing | | 1 | 5 | 100b | 10.000μs | 10.000μs | 10.000μs | 10.000μs | 0.000μs | ±0.00% |
-| | NothingBench | benchNothing | | 1 | 5 | 100b | 10.000μs | 10.000μs | 10.000μs | 10.000μs | 0.000μs | ±0.00% |
-| | NothingBench | benchNothing | | 1 | 5 | 100b | 10.000μs | 10.000μs | 10.000μs | 10.000μs | 0.000μs | ±0.00% |
-| | NothingBench | benchNothing | | 1 | 5 | 100b | 10.000μs | 10.000μs | 10.000μs | 10.000μs | 0.000μs | ±0.00% |
-+-----------+--------------+--------------+-----+------+-----+----------+----------+----------+----------+----------+---------+--------+
-
diff --git a/examples/Command/report-generators-break b/examples/Command/report-generators-break
index 72a143e7f..023b28d42 100644
--- a/examples/Command/report-generators-break
+++ b/examples/Command/report-generators-break
@@ -8,21 +8,12 @@
}
}
---
-phpbench run --report=my-report --executor=debug MultipleSubjects.php NothingBench.php --progress=none
+phpbench run --report=my-report --executor=debug . --progress=none
---
-MultipleSubjectBench
-+---------------+-----+------+-----+----------+----------+--------+
-| subject | set | revs | its | mem_peak | mode | rstdev |
-+---------------+-----+------+-----+----------+----------+--------+
-| benchSubject1 | | 1 | 1 | 100b | 10.000μs | ±0.00% |
-| benchSubject2 | | 1 | 1 | 100b | 10.000μs | ±0.00% |
-| benchSubject3 | | 1 | 1 | 100b | 10.000μs | ±0.00% |
-+---------------+-----+------+-----+----------+----------+--------+
-
NothingBench
+--------------+-----+------+-----+----------+----------+--------+
| subject | set | revs | its | mem_peak | mode | rstdev |
+--------------+-----+------+-----+----------+----------+--------+
-| benchNothing | | 1 | 1 | 100b | 10.000μs | ±0.00% |
+| benchNothing | 0 | 1 | 1 | 100b | 10.000μs | ±0.00% |
+--------------+-----+------+-----+----------+----------+--------+
diff --git a/examples/Command/report-generators-column-diff b/examples/Command/report-generators-column-diff
deleted file mode 100644
index 95788ce8c..000000000
--- a/examples/Command/report-generators-column-diff
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "runner.executor": "debug-example",
- "runner.iterations": 5,
- "runner.executors": {
- "debug-example": {
- "executor": "debug",
- "times":[10, 20, 30, 40, 50]
- }
- },
- "report.generators": {
- "my-report": {
- "generator": "expression",
- "aggregate": ["iteration_index"],
- "expressions": {
- "_mode": "mode(result_time_avg)"
- },
- "cols": [
- "subject",
- "mode",
- "diff"
- ],
- "derivations": {
- "diff": "if(min(table['_mode']) > 0, format('%.2fx', row['_mode'] / min(table['_mode'])), 'N/A')"
- }
- }
- }
-}
----
-phpbench run --report=my-report --executor=debug NothingBench.php --progress=none
----
-+--------------+----------+-------+
-| subject | mode | diff |
-+--------------+----------+-------+
-| benchNothing | 10.000μs | 1.00x |
-| benchNothing | 20.000μs | 2.00x |
-| benchNothing | 30.000μs | 3.00x |
-| benchNothing | 40.000μs | 4.00x |
-| benchNothing | 50.000μs | 5.00x |
-+--------------+----------+-------+
-
diff --git a/examples/Command/report-generators-column-override b/examples/Command/report-generators-column-override
index c2e7fa6b3..9b65b9cf4 100644
--- a/examples/Command/report-generators-column-override
+++ b/examples/Command/report-generators-column-override
@@ -13,6 +13,7 @@
---
phpbench run --report=my-report --executor=debug NothingBench.php --progress=none
---
+
+--------------+----------+---------------------+
| subject | mode | hello |
+--------------+----------+---------------------+
diff --git a/examples/Command/report-generators-column-visibility b/examples/Command/report-generators-column-visibility
index 62186db39..f6cfbe96d 100644
--- a/examples/Command/report-generators-column-visibility
+++ b/examples/Command/report-generators-column-visibility
@@ -9,6 +9,7 @@
---
phpbench run --report=my-report --executor=debug NothingBench.php --progress=none
---
+
+--------------+----------+
| subject | mode |
+--------------+----------+
diff --git a/examples/Command/report-generators-component b/examples/Command/report-generators-component
deleted file mode 100644
index 97596ddca..000000000
--- a/examples/Command/report-generators-component
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "runner.path": "NothingBench.php",
- "runner.executor": "debug",
- "runner.env_enabled_providers": ["test"],
- "report.generators": {
- "chart": {
- "generator": "component",
- "components": [
- {
- "component": "bar_chart_aggregate",
- "title": "Example Bar Chart",
- "x_partition": ["benchmark_name"],
- "bar_partition": ["suite_tag"],
- "y_expr": "mode(partition[\"result_time_avg\"])",
- "y_axes_label": "yValue as time precision 1"
- },
- {
- "component": "table_aggregate",
- "title": "Table",
- "row": {
- "benchmark": "first(partition[\"benchmark_name\"])",
- "net_time": "sum(partition[\"result_time_net\"])"
- }
- }
- ]
- }
- }
-}
----
-phpbench run --report=chart
----
-Example Bar Chart
-
-10.0μs │ █
-8.8μs │ █
-7.5μs │ █
-6.3μs │ █
-5.0μs │ █
-3.8μs │ █
-2.5μs │ █
-1.3μs │ █
- └───
- 1
-
-[█ ]
-
-1: NothingBench
-
-Table
-+--------------+----------+
-| benchmark | net_time |
-+--------------+----------+
-| NothingBench | 10 |
-+--------------+----------+
-
diff --git a/examples/Command/report-generators-composite b/examples/Command/report-generators-composite
index 564c58407..1578a8d17 100644
--- a/examples/Command/report-generators-composite
+++ b/examples/Command/report-generators-composite
@@ -12,16 +12,18 @@
---
phpbench run --report=all
---
+
+------+--------------+--------------+-----+------+----------+----------+--------------+----------------+
| iter | benchmark | subject | set | revs | mem_peak | time_avg | comp_z_value | comp_deviation |
+------+--------------+--------------+-----+------+----------+----------+--------------+----------------+
-| 0 | NothingBench | benchNothing | | 1 | 100b | 10.000μs | +0.00σ | +0.00% |
+| 0 | benchNothing | benchNothing | 0 | 1 | 100b | 10.000μs | +0.00σ | +0.00% |
+------+--------------+--------------+-----+------+----------+----------+--------------+----------------+
+
+--------------+--------------+-----+------+-----+----------+----------+--------+
| benchmark | subject | set | revs | its | mem_peak | mode | rstdev |
+--------------+--------------+-----+------+-----+----------+----------+--------+
-| NothingBench | benchNothing | | 1 | 1 | 100b | 10.000μs | ±0.00% |
+| NothingBench | benchNothing | 0 | 1 | 1 | 100b | 10.000μs | ±0.00% |
+--------------+--------------+-----+------+-----+----------+----------+--------+
Suite E3X6AeMdP7L9E7E0X0A7McP1L8E1EdXbAbMbP7La xxxx-xx-xx xx-xx-xx
diff --git a/examples/Command/report-generators-data b/examples/Command/report-generators-data
index 01997e225..adff7c830 100644
--- a/examples/Command/report-generators-data
+++ b/examples/Command/report-generators-data
@@ -4,6 +4,7 @@
---
phpbench run --report='extends:bare,vertical:true' --executor=debug NothingBench.php --progress=none
---
+
+------------------------+---------------+
| field | value |
+------------------------+---------------+
@@ -15,8 +16,7 @@ phpbench run --report='extends:bare,vertical:true' --executor=debug NothingBench
| subject_time_unit | null |
| subject_time_precision | null |
| subject_time_mode | null |
-| variant_index | 0 |
-| variant_name | |
+| variant_name | 0 |
| variant_params | [] |
| variant_revs | 1 |
| variant_iterations | 1 |
diff --git a/examples/Command/report-generators-derivations b/examples/Command/report-generators-derivations
deleted file mode 100644
index 275c0fba4..000000000
--- a/examples/Command/report-generators-derivations
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "report.generators": {
- "my-report": {
- "generator": "expression",
- "cols": [ "benchmark", "subject", "mode", "super mode" ],
- "derivations": {
- "super mode": "row['mode'] ~ ' of ' ~ sum(table['mode'])"
- }
- }
- }
-}
----
-phpbench run --report=my-report --executor=debug MultipleSubjects.php --progress=none
----
-+----------------------+---------------+----------+------------+
-| benchmark | subject | mode | super mode |
-+----------------------+---------------+----------+------------+
-| MultipleSubjectBench | benchSubject1 | 10.000μs | 10 of 30 |
-| MultipleSubjectBench | benchSubject2 | 10.000μs | 10 of 30 |
-| MultipleSubjectBench | benchSubject3 | 10.000μs | 10 of 30 |
-+----------------------+---------------+----------+------------+
-
diff --git a/examples/Command/report-generators-expression b/examples/Command/report-generators-expression
index f339e0829..cf3f3ce98 100644
--- a/examples/Command/report-generators-expression
+++ b/examples/Command/report-generators-expression
@@ -3,9 +3,10 @@
---
phpbench run --report=expression --executor=debug NothingBench.php --progress=none
---
+
+-----------+--------------+--------------+-----+------+-----+----------+----------+----------+----------+----------+---------+--------+
| tag | benchmark | subject | set | revs | its | mem_peak | best | mode | mean | worst | stdev | rstdev |
+-----------+--------------+--------------+-----+------+-----+----------+----------+----------+----------+----------+---------+--------+
-| | NothingBench | benchNothing | | 1 | 1 | 100b | 10.000μs | 10.000μs | 10.000μs | 10.000μs | 0.000μs | ±0.00% |
+| | NothingBench | benchNothing | 0 | 1 | 1 | 100b | 10.000μs | 10.000μs | 10.000μs | 10.000μs | 0.000μs | ±0.00% |
+-----------+--------------+--------------+-----+------+-----+----------+----------+----------+----------+----------+---------+--------+
diff --git a/examples/Command/report-generators-expressions b/examples/Command/report-generators-expressions
index 84b13b602..8d28ff3d0 100644
--- a/examples/Command/report-generators-expressions
+++ b/examples/Command/report-generators-expressions
@@ -3,17 +3,18 @@
"my-report": {
"generator": "expression",
"expressions": {
- "new_mode": "\"This is the mode: \" ~ mode(result_time_avg)"
+ "mode": "\"This is the mode: \" ~ mode(result_time_avg)"
},
- "cols": [ "benchmark", "subject", "new_mode" ]
+ "cols": [ "benchmark", "subject", "mode" ]
}
}
}
---
phpbench run --report=my-report --executor=debug NothingBench.php --progress=none
---
+
+--------------+--------------+----------------------+
-| benchmark | subject | new_mode |
+| benchmark | subject | mode |
+--------------+--------------+----------------------+
| NothingBench | benchNothing | This is the mode: 10 |
+--------------+--------------+----------------------+
diff --git a/examples/Command/report-generators-filter-value b/examples/Command/report-generators-filter-value
deleted file mode 100644
index 3f17d1a00..000000000
--- a/examples/Command/report-generators-filter-value
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "report.generators": {
- "my-report": {
- "generator": "expression",
- "cols": {
- "subject": null,
- "difference": "percent_diff(mode(result_time_avg), mode(suite[subject_name = \"benchNothing\"][\"result_time_avg\"]))"
- }
- }
- }
-}
----
-phpbench run --report=my-report --executor=debug NothingBench.php --progress=none
----
-+--------------+------------+
-| subject | difference |
-+--------------+------------+
-| benchNothing | 0.00% |
-+--------------+------------+
-
diff --git a/examples/Command/report-output-html b/examples/Command/report-output-html
deleted file mode 100644
index f514db300..000000000
--- a/examples/Command/report-output-html
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "report.outputs": {
- "build-artifact": {
- "renderer": "html",
- "path": "path/to/something.html",
- "title": "All Your Benchmark Are Belong to Us"
- }
- }
-}
----
-phpbench run --report=aggregate --executor=debug --output=build-artifact NothingBench.php
----
-Written report to: /path/to/tests/Workspace/path/to/something.html
diff --git a/examples/Command/report-ref-latest-and-aggregate b/examples/Command/report-ref-latest-and-aggregate
index 7335cbab6..8ef03e21f 100644
--- a/examples/Command/report-ref-latest-and-aggregate
+++ b/examples/Command/report-ref-latest-and-aggregate
@@ -3,12 +3,13 @@
"runner.executor": "debug"
}
---
-phpbench run --tag=main
-phpbench report --ref=main --report=aggregate
+phpbench run --store
+phpbench report --ref=latest --report=aggregate
---
+
+--------------+--------------+-----+------+-----+----------+----------+--------+
| benchmark | subject | set | revs | its | mem_peak | mode | rstdev |
+--------------+--------------+-----+------+-----+----------+----------+--------+
-| NothingBench | benchNothing | | 1 | 1 | 100b | 10.000μs | ±0.00% |
+| NothingBench | benchNothing | 0 | 1 | 1 | 100b | 10.000μs | ±0.00% |
+--------------+--------------+-----+------+-----+----------+----------+--------+
diff --git a/examples/Command/run-configuring-reports-extend b/examples/Command/run-configuring-reports-extend
index d9f87dfa9..623c71766 100644
--- a/examples/Command/run-configuring-reports-extend
+++ b/examples/Command/run-configuring-reports-extend
@@ -5,7 +5,7 @@
---
phpbench run --report='extends: aggregate, break: ["benchmark", "set"]'
---
-NothingBench-
+NothingBench-0
+--------------+------+-----+----------+----------+--------+
| subject | revs | its | mem_peak | mode | rstdev |
+--------------+------+-----+----------+----------+--------+
diff --git a/examples/Command/run-reports-aggregate b/examples/Command/run-reports-aggregate
index 9cf9f623b..86bce5da1 100644
--- a/examples/Command/run-reports-aggregate
+++ b/examples/Command/run-reports-aggregate
@@ -5,9 +5,10 @@
---
phpbench run --report=aggregate
---
+
+--------------+--------------+-----+------+-----+----------+----------+--------+
| benchmark | subject | set | revs | its | mem_peak | mode | rstdev |
+--------------+--------------+-----+------+-----+----------+----------+--------+
-| NothingBench | benchNothing | | 1 | 1 | 100b | 10.000μs | ±0.00% |
+| NothingBench | benchNothing | 0 | 1 | 1 | 100b | 10.000μs | ±0.00% |
+--------------+--------------+-----+------+-----+----------+----------+--------+
diff --git a/examples/Command/run-reports-aggregate-and-env b/examples/Command/run-reports-aggregate-and-env
index 48b42f07a..5b870f219 100644
--- a/examples/Command/run-reports-aggregate-and-env
+++ b/examples/Command/run-reports-aggregate-and-env
@@ -5,10 +5,11 @@
---
phpbench run --report=aggregate --report=env
---
+
+--------------+--------------+-----+------+-----+----------+----------+--------+
| benchmark | subject | set | revs | its | mem_peak | mode | rstdev |
+--------------+--------------+-----+------+-----+----------+----------+--------+
-| NothingBench | benchNothing | | 1 | 1 | 100b | 10.000μs | ±0.00% |
+| NothingBench | benchNothing | 0 | 1 | 1 | 100b | 10.000μs | ±0.00% |
+--------------+--------------+-----+------+-----+----------+----------+--------+
Suite E3X6AeMdP7L9E7E0X0A7McP1L8E1EdXbAbMbP7La xxxx-xx-xx xx-xx-xx
diff --git a/examples/Command/run-reports-benchmark b/examples/Command/run-reports-benchmark
deleted file mode 100644
index c82035b63..000000000
--- a/examples/Command/run-reports-benchmark
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "runner.path": "NothingBench.php",
- "runner.executor": "debug"
-}
----
-phpbench run --report=benchmark --iterations=4
----
-NothingBench
-============
-
-Average iteration times by variant
-
-10.0μs │ █
-8.8μs │ █
-7.5μs │ █
-6.3μs │ █
-5.0μs │ █
-3.8μs │ █
-2.5μs │ █
-1.3μs │ █
- └───
- 1
-
-[█ ]
-
-1: benchNothing
-
-Memory by variant
-
-100b │ █
-88b │ █
-75b │ █
-63b │ █
-50b │ █
-38b │ █
-25b │ █
-13b │ █
- └───
- 1
-
-[█ ]
-
-1: benchNothing
-
-
-+-----------------+--------+----------+--------+---------+
-| subject | memory | mode | rstdev | stdev |
-+-----------------+--------+----------+--------+---------+
-| benchNothing () | 100b | 10.000μs | ±0.00% | 0.000μs |
-+-----------------+--------+----------+--------+---------+
-
diff --git a/examples/Command/run-reports-default b/examples/Command/run-reports-default
index b13ec15a1..b6f8b35fb 100644
--- a/examples/Command/run-reports-default
+++ b/examples/Command/run-reports-default
@@ -5,12 +5,13 @@
---
phpbench run --report=default --iterations=4
---
+
+------+--------------+--------------+-----+------+----------+----------+--------------+----------------+
| iter | benchmark | subject | set | revs | mem_peak | time_avg | comp_z_value | comp_deviation |
+------+--------------+--------------+-----+------+----------+----------+--------------+----------------+
-| 0 | NothingBench | benchNothing | | 1 | 100b | 10.000μs | +0.00σ | +0.00% |
-| 1 | NothingBench | benchNothing | | 1 | 100b | 10.000μs | +0.00σ | +0.00% |
-| 2 | NothingBench | benchNothing | | 1 | 100b | 10.000μs | +0.00σ | +0.00% |
-| 3 | NothingBench | benchNothing | | 1 | 100b | 10.000μs | +0.00σ | +0.00% |
+| 0 | benchNothing | benchNothing | 0 | 1 | 100b | 10.000μs | +0.00σ | +0.00% |
+| 1 | benchNothing | benchNothing | 0 | 1 | 100b | 10.000μs | +0.00σ | +0.00% |
+| 2 | benchNothing | benchNothing | 0 | 1 | 100b | 10.000μs | +0.00σ | +0.00% |
+| 3 | benchNothing | benchNothing | 0 | 1 | 100b | 10.000μs | +0.00σ | +0.00% |
+------+--------------+--------------+-----+------+----------+----------+--------------+----------------+
diff --git a/examples/Command/run-reports-overview b/examples/Command/run-reports-overview
deleted file mode 100644
index 4b1e38dea..000000000
--- a/examples/Command/run-reports-overview
+++ /dev/null
@@ -1,78 +0,0 @@
-{
- "runner.path": "NothingBench.php",
- "runner.executor": "debug"
-}
----
-phpbench run --report=overview --iterations=4
----
-Overview
-========
-
-Suites
-+-----------+---------------------+------+------------+--------+------------+------+----------+----------+
-| suite | date | php | vcs branch | xdebug | iterations | revs | mode | net_time |
-+-----------+---------------------+------+------------+--------+------------+------+----------+----------+
-| | xxxx-xx-xx xx-xx-xx | null | null | null | 4 | 4 | 10.000μs | 40.000μs |
-+-----------+---------------------+------+------------+--------+------------+------+----------+----------+
-
-Average iteration times aggregated by benchmark
-
-10.0μs │ █
-8.8μs │ █
-7.5μs │ █
-6.3μs │ █
-5.0μs │ █
-3.8μs │ █
-2.5μs │ █
-1.3μs │ █
- └───
- 1
-
-[█ ]
-
-1: NothingBench
-
-Average peak memory aggregated by benchmark
-
-100b │ █
-88b │ █
-75b │ █
-63b │ █
-50b │ █
-38b │ █
-25b │ █
-13b │ █
- └───
- 1
-
-[█ ]
-
-1: NothingBench
-
-By Benchmark
-
-10.0μs │ █
-8.8μs │ █
-7.5μs │ █
-6.3μs │ █
-5.0μs │ █
-3.8μs │ █
-2.5μs │ █
-1.3μs │ █
- └───
- 1
-
-[█ NothingBench]
-
-1:
-
-Table
-=====
-
-
-+--------------+-----------------+--------+----------+----------+----------+--------+---------+
-| benchmark | subject | memory | min | max | mode | rstdev | stdev |
-+--------------+-----------------+--------+----------+----------+----------+--------+---------+
-| NothingBench | benchNothing () | 100b | 10.000μs | 10.000μs | 10.000μs | ±0.00% | 0.000μs |
-+--------------+-----------------+--------+----------+----------+----------+--------+---------+
-
diff --git a/examples/Expression/contains_1 b/examples/Expression/contains_1
deleted file mode 100644
index 7e532fc8d..000000000
--- a/examples/Expression/contains_1
+++ /dev/null
@@ -1,3 +0,0 @@
-contains([2, 3, 4], 1) = false
-contains([1, 3, 4], 1) = true
-contains([1, "hello", 4], "hello") = true
diff --git a/examples/Expression/count_1 b/examples/Expression/count_1
deleted file mode 100644
index 0bce59aeb..000000000
--- a/examples/Expression/count_1
+++ /dev/null
@@ -1 +0,0 @@
-count([1, 2, 3]) = 3
diff --git a/examples/Expression/filter_1 b/examples/Expression/filter_1
deleted file mode 100644
index bfdc9b6ee..000000000
--- a/examples/Expression/filter_1
+++ /dev/null
@@ -1,3 +0,0 @@
-data[column1 = "value1"] = frame(["column1", "column2"], [["value1", "value2"]])
-data[column1 = "value1"]["column1"] = ["value1"]
-first(data[column1 = "value1"]["column1"]) = "value1"
diff --git a/examples/Expression/first_1 b/examples/Expression/first_1
index ec1216ae8..84dd7b1b5 100644
--- a/examples/Expression/first_1
+++ b/examples/Expression/first_1
@@ -1,2 +1 @@
first(["one", "two"]) = "one"
-first([]) = null
diff --git a/examples/Expression/frame_1 b/examples/Expression/frame_1
deleted file mode 100644
index 7b997ce16..000000000
--- a/examples/Expression/frame_1
+++ /dev/null
@@ -1 +0,0 @@
-frame(["column1"], [["value1"],["value2"]])[column1 = "value1"] = frame(["column1"], [["value1"]])
diff --git a/examples/Expression/func_max b/examples/Expression/func_max
index 1e6edeaa9..1de359e24 100644
--- a/examples/Expression/func_max
+++ b/examples/Expression/func_max
@@ -1,2 +1 @@
max([10, 12, 4, 20]) = 20
-max([]) = null
diff --git a/examples/Expression/func_min b/examples/Expression/func_min
index e844fabc9..775e1b528 100644
--- a/examples/Expression/func_min
+++ b/examples/Expression/func_min
@@ -1,2 +1 @@
min([10, 12, 4, 20]) = 4
-min([]) = null
diff --git a/examples/Expression/if_1 b/examples/Expression/if_1
deleted file mode 100644
index 2ec18dc94..000000000
--- a/examples/Expression/if_1
+++ /dev/null
@@ -1 +0,0 @@
-if(1 = 1, "hello", "goodbye")
diff --git a/examples/Expression/null_safe_1 b/examples/Expression/null_safe_1
deleted file mode 100644
index 98f9ce6e3..000000000
--- a/examples/Expression/null_safe_1
+++ /dev/null
@@ -1 +0,0 @@
-data?["bar"] = null
diff --git a/examples/Expression/sum_1 b/examples/Expression/sum_1
deleted file mode 100644
index 525d35c8b..000000000
--- a/examples/Expression/sum_1
+++ /dev/null
@@ -1 +0,0 @@
-sum([1, 2, 3]) = 6
diff --git a/examples/Expression/time_convert_1 b/examples/Expression/time_convert_1
deleted file mode 100644
index 947a67762..000000000
--- a/examples/Expression/time_convert_1
+++ /dev/null
@@ -1,4 +0,0 @@
-time_convert(1000, 'milliseconds', 'seconds') = 1
-time_convert(1, 'seconds', 'milliseconds') = 1000
-time_convert(1, 'us', 'milliseconds') = 0.001
-time_convert(1000, 'us', 'milliseconds') = 1
diff --git a/examples/Expression/time_unit_func_1 b/examples/Expression/time_unit_func_1
deleted file mode 100644
index ce86165fa..000000000
--- a/examples/Expression/time_unit_func_1
+++ /dev/null
@@ -1,4 +0,0 @@
-time_unit("milliseconds") = "milliseconds"
-time_unit("ms") = "milliseconds"
-time_unit("ms", true) = "ms"
-time_unit("ms", false) = "milliseconds"
diff --git a/examples/Extension/AcmeExtension.php b/examples/Extension/AcmeExtension.php
index 12eee97f9..94b5bf353 100644
--- a/examples/Extension/AcmeExtension.php
+++ b/examples/Extension/AcmeExtension.php
@@ -1,13 +1,10 @@
[]
]);
// endsection: command_di
-
+
// section: progress_logger_di
$container->register(CatLogger::class, function (Container $container) {
return new CatLogger(
@@ -81,16 +78,6 @@ public function load(Container $container): void
]
]);
// endsection: executor_di
-
- // section: env_provider_di
- $container->register(HomeProvider::class, function (Container $container) {
- return new HomeProvider();
- }, [
- RunnerExtension::TAG_ENV_PROVIDER => [
- 'name' => 'home',
- ]
- ]);
- // endsection: env_provider_di
// section: all
}
}
diff --git a/examples/Extension/Command/CatsCommand.php b/examples/Extension/Command/CatsCommand.php
index 53e055216..25fc1893d 100644
--- a/examples/Extension/Command/CatsCommand.php
+++ b/examples/Extension/Command/CatsCommand.php
@@ -9,17 +9,23 @@
class CatsCommand extends Command
{
- public function __construct(private readonly int $numberOfCats)
+ /**
+ * @var int
+ */
+ private $numberOfCats;
+
+ public function __construct(int $numberOfCats)
{
+ $this->numberOfCats = $numberOfCats;
parent::__construct();
}
- protected function configure(): void
+ protected function configure()
{
$this->setName('cats');
}
- protected function execute(InputInterface $input, OutputInterface $output): int
+ protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln(str_repeat('🐈', $this->numberOfCats));
diff --git a/examples/Extension/Environment/HomeProvider.php b/examples/Extension/Environment/HomeProvider.php
deleted file mode 100644
index 7ee8b8771..000000000
--- a/examples/Extension/Environment/HomeProvider.php
+++ /dev/null
@@ -1,23 +0,0 @@
- getenv('HOME'),
- ]);
- }
-}
diff --git a/examples/Extension/ProgressLogger/CatLogger.php b/examples/Extension/ProgressLogger/CatLogger.php
index ea8957a50..afebb48ae 100644
--- a/examples/Extension/ProgressLogger/CatLogger.php
+++ b/examples/Extension/ProgressLogger/CatLogger.php
@@ -2,7 +2,6 @@
namespace PhpBench\Examples\Extension\ProgressLogger;
-use PhpBench\Benchmark\RunnerConfig;
use PhpBench\Model\Benchmark;
use PhpBench\Model\Iteration;
use PhpBench\Model\Subject;
@@ -13,11 +12,17 @@
class CatLogger implements LoggerInterface
{
- public function __construct(private readonly OutputInterface $output)
+ /**
+ * @var OutputInterface
+ */
+ private $output;
+
+ public function __construct(OutputInterface $output)
{
+ $this->output = $output;
}
- public function startSuite(RunnerConfig $config, Suite $suite)
+ public function startSuite(Suite $suite)
{
}
diff --git a/examples/OutputTest/OutputTestBench.php b/examples/OutputTest/OutputTestBench.php
index 30328d888..d9a6b3476 100644
--- a/examples/OutputTest/OutputTestBench.php
+++ b/examples/OutputTest/OutputTestBench.php
@@ -20,7 +20,7 @@ public function benchFailure()
{
}
- public function benchError(): never
+ public function benchError()
{
throw new RuntimeException("Example error");
}
diff --git a/extensions/xdebug/lib/Command/Handler/OutputDirHandler.php b/extensions/xdebug/lib/Command/Handler/OutputDirHandler.php
index 01f84338f..3fbfe63ac 100644
--- a/extensions/xdebug/lib/Command/Handler/OutputDirHandler.php
+++ b/extensions/xdebug/lib/Command/Handler/OutputDirHandler.php
@@ -12,12 +12,12 @@
namespace PhpBench\Extensions\XDebug\Command\Handler;
-use Symfony\Component\Filesystem\Path;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
+use Webmozart\PathUtil\Path;
class OutputDirHandler
{
@@ -36,7 +36,7 @@ class OutputDirHandler
*/
private $cwd;
- public function __construct(string $outputDir, string $cwd, ?Filesystem $filesystem = null)
+ public function __construct(string $outputDir, string $cwd, Filesystem $filesystem = null)
{
$this->outputDir = $outputDir;
$this->filesystem = $filesystem ?: new Filesystem();
diff --git a/extensions/xdebug/lib/Command/ProfileCommand.php b/extensions/xdebug/lib/Command/ProfileCommand.php
index ff573435e..daee1dcf2 100644
--- a/extensions/xdebug/lib/Command/ProfileCommand.php
+++ b/extensions/xdebug/lib/Command/ProfileCommand.php
@@ -12,7 +12,6 @@
namespace PhpBench\Extensions\XDebug\Command;
-use InvalidArgumentException;
use PhpBench\Benchmark\RunnerConfig;
use PhpBench\Console\Command\Handler\RunnerHandler;
use PhpBench\Extensions\XDebug\Command\Handler\OutputDirHandler;
@@ -21,51 +20,41 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Process\ExecutableFinder;
use Symfony\Component\Process\Process;
class ProfileCommand extends Command
{
- /**
- * @var RunnerHandler
- */
private $runnerHandler;
- /**
- * @var OutputDirHandler
- */
+ private $filesystem;
private $outputDirHandler;
- /**
- * @var XDebugUtil
- */
- private $xdebugUtil;
public function __construct(
RunnerHandler $runnerHandler,
OutputDirHandler $outputDirHandler,
- XDebugUtil $xdebugUtil
+ Filesystem $filesystem = null
) {
parent::__construct();
$this->runnerHandler = $runnerHandler;
+ $this->filesystem = $filesystem ?: new Filesystem();
$this->outputDirHandler = $outputDirHandler;
- $this->xdebugUtil = $xdebugUtil;
}
public function configure(): void
{
$this->setName('xdebug:profile');
- $this->setDescription(
- <<<'EOT'
+ $this->setDescription(<<<'EOT'
Generate and optionally visualize profiles with Xdebug
EOT
);
RunnerHandler::configure($this);
OutputDirHandler::configure($this);
-
$this->addOption('gui', null, InputOption::VALUE_NONE);
$this->addOption('gui-bin', null, InputOption::VALUE_REQUIRED, 'Bin to use to display cachegrind output', 'kcachegrind');
}
- public function execute(InputInterface $input, OutputInterface $output): int
+ public function execute(InputInterface $input, OutputInterface $output)
{
$outputDir = $this->outputDirHandler->handleOutputDir($input, $output);
$guiBin = null;
@@ -75,9 +64,8 @@ public function execute(InputInterface $input, OutputInterface $output): int
$guiBin = $finder->find($input->getOption('gui-bin'));
if (null === $guiBin) {
- throw new InvalidArgumentException(sprintf(
- 'Could not locate GUI bin "%s"',
- $input->getOption('gui-bin')
+ throw new \InvalidArgumentException(sprintf(
+ 'Could not locate GUI bin "%s"', $input->getOption('gui-bin')
));
}
}
@@ -88,10 +76,12 @@ public function execute(InputInterface $input, OutputInterface $output): int
'executor' => 'xdebug_profile',
'output_dir' => $outputDir,
'callback' => function ($iteration) use ($outputDir, $guiBin, &$generatedFiles): void {
- $generatedFiles[] = $generatedFile = $outputDir . DIRECTORY_SEPARATOR . $this->xdebugUtil->filenameFromContext($iteration, $this->xdebugUtil->getCachegrindExtensionOfGeneratedFile());
+ $generatedFiles[] = $generatedFile = $outputDir . DIRECTORY_SEPARATOR . XDebugUtil::filenameFromContext($iteration, '.cachegrind');
if ($guiBin) {
- $process = Process::fromShellCommandline($guiBin . ' ' . $generatedFile);
+ $process = Process::fromShellCommandline(sprintf(
+ $guiBin . ' ' . $generatedFile
+ ));
$process->run();
}
},
@@ -108,7 +98,7 @@ public function execute(InputInterface $input, OutputInterface $output): int
foreach ($generatedFiles as $generatedFile) {
if (!file_exists($generatedFile)) {
- throw new InvalidArgumentException(sprintf(
+ throw new \InvalidArgumentException(sprintf(
'Profile "%s" was not generated. Perhaps you do not have Xdebug installed or the extension is not enabled for your benchmark?',
$generatedFile
));
diff --git a/extensions/xdebug/lib/Executor/ProfileExecutor.php b/extensions/xdebug/lib/Executor/ProfileExecutor.php
index b4084dcbb..c02f36203 100644
--- a/extensions/xdebug/lib/Executor/ProfileExecutor.php
+++ b/extensions/xdebug/lib/Executor/ProfileExecutor.php
@@ -17,9 +17,10 @@
use PhpBench\Executor\ExecutionContext;
use PhpBench\Executor\ExecutionResults;
use PhpBench\Extensions\XDebug\XDebugUtil;
-use Symfony\Component\Filesystem\Path;
use PhpBench\Registry\Config;
+use RuntimeException;
use Symfony\Component\OptionsResolver\OptionsResolver;
+use Webmozart\PathUtil\Path;
class ProfileExecutor implements BenchmarkExecutorInterface
{
@@ -33,16 +34,10 @@ class ProfileExecutor implements BenchmarkExecutorInterface
*/
private $cwd;
- /**
- * @var XDebugUtil
- */
- private $xdebugUtil;
-
- public function __construct(TemplateExecutor $innerExecutor, XDebugUtil $xdebugUtil, string $cwd)
+ public function __construct(TemplateExecutor $innerExecutor, string $cwd)
{
$this->innerExecutor = $innerExecutor;
$this->cwd = $cwd;
- $this->xdebugUtil = $xdebugUtil;
}
/**
@@ -57,15 +52,13 @@ public function configure(OptionsResolver $options): void
},
'output_dir' => 'xdebug',
]);
- $options->setAllowedTypes('callback', ['Closure']);
- $options->setAllowedTypes('output_dir', ['string']);
}
public function execute(ExecutionContext $context, Config $config): ExecutionResults
{
$outputDir = $config['output_dir'];
$callback = $config['callback'];
- $name = $this->xdebugUtil->filenameFromContext($context, '.cachegrind');
+ $name = XDebugUtil::filenameFromContext($context, '.cachegrind');
$config[TemplateExecutor::OPTION_PHP_CONFIG] = $this->resolveXdebugIniSettings($outputDir, $name);
$results = $this->innerExecutor->execute($context, $config);
@@ -80,11 +73,17 @@ public function execute(ExecutionContext $context, Config $config): ExecutionRes
*/
private function resolveXdebugIniSettings(string $outputDir, string $name): array
{
- $xdebugVersion = $this->xdebugUtil->discoverXdebugMajorVersion();
+ $xdebugVersion = phpversion('xdebug');
+
+ if (false === $xdebugVersion) {
+ throw new RuntimeException(
+ 'Xdebug is not installed'
+ );
+ }
$outputPath = Path::makeAbsolute($outputDir, $this->cwd);
- if ($xdebugVersion === '3') {
+ if (substr($xdebugVersion, 0, 1) === '3') {
return [
'xdebug.mode' => 'profile',
'xdebug.output_dir' => $outputPath,
diff --git a/extensions/xdebug/lib/XDebugExtension.php b/extensions/xdebug/lib/XDebugExtension.php
index 4372dde51..84abced3f 100644
--- a/extensions/xdebug/lib/XDebugExtension.php
+++ b/extensions/xdebug/lib/XDebugExtension.php
@@ -29,7 +29,7 @@
class XDebugExtension implements ExtensionInterface
{
- public const PARAM_OUTPUT_DIR = 'xdebug.command_handler_output_dir';
+ const PARAM_OUTPUT_DIR = 'xdebug.command_handler_output_dir';
public function configure(OptionsResolver $resolver): void
{
@@ -44,14 +44,10 @@ public function configure(OptionsResolver $resolver): void
public function load(Container $container): void
{
- $container->register(XDebugUtil::class, function (Container $container) {
- return XDebugUtil::fromEnvironment();
- });
$container->register(ProfileCommand::class, function (Container $container) {
return new ProfileCommand(
$container->get(RunnerHandler::class),
- $container->get(self::PARAM_OUTPUT_DIR),
- $container->get(XDebugUtil::class)
+ $container->get(self::PARAM_OUTPUT_DIR)
);
}, [
ConsoleExtension::TAG_CONSOLE_COMMAND => []
@@ -68,7 +64,6 @@ public function load(Container $container): void
return new CompositeExecutor(
new ProfileExecutor(
$container->get(RemoteExecutor::class),
- $container->get(XDebugUtil::class),
$container->getParameter(CoreExtension::PARAM_WORKING_DIR)
),
$container->get(RemoteMethodExecutor::class)
diff --git a/extensions/xdebug/lib/XDebugUtil.php b/extensions/xdebug/lib/XDebugUtil.php
index 29595f06b..db952a2be 100644
--- a/extensions/xdebug/lib/XDebugUtil.php
+++ b/extensions/xdebug/lib/XDebugUtil.php
@@ -13,40 +13,10 @@
namespace PhpBench\Extensions\XDebug;
use PhpBench\Executor\ExecutionContext;
-use RuntimeException;
class XDebugUtil
{
- public static function fromEnvironment(): XDebugUtil
- {
- $xdebugVersion = phpversion('xdebug');
- $xdebugUseCompression = ini_get('xdebug.use_compression') === '1';
-
- return new XDebugUtil($xdebugVersion, $xdebugUseCompression);
- }
-
- /**
- * @var string|false
- */
- private $xdebugVersion;
- /**
- * @var bool
- */
- private $xdebugUseCompression;
-
- /**
- * @param string|false $xdebugVersion
- */
- public function __construct($xdebugVersion, bool $xdebugUseCompression)
- {
- $this->xdebugVersion = $xdebugVersion;
- $this->xdebugUseCompression = $xdebugUseCompression;
- }
-
- /**
- * @param string $extension
- */
- public function filenameFromContext(ExecutionContext $context, $extension = ''): string
+ public static function filenameFromContext(ExecutionContext $context, $extension = ''): string
{
$name = sprintf(
'%s%s%s',
@@ -58,26 +28,4 @@ public function filenameFromContext(ExecutionContext $context, $extension = ''):
return md5($name) . $extension;
}
-
- public function getCachegrindExtensionOfGeneratedFile(): string
- {
- $xdebugVersion = $this->discoverXdebugMajorVersion();
-
- if ($xdebugVersion === '3' && $this->xdebugUseCompression) {
- return '.cachegrind.gz';
- }
-
- return '.cachegrind';
- }
-
- public function discoverXdebugMajorVersion(): string
- {
- if ($this->xdebugVersion === false) {
- throw new RuntimeException(
- 'Xdebug is not installed'
- );
- }
-
- return substr($this->xdebugVersion, 0, 1);
- }
}
diff --git a/extensions/xdebug/tests/System/XDebugTestCase.php b/extensions/xdebug/tests/System/XDebugTestCase.php
index e8155debe..d1e7cf68b 100644
--- a/extensions/xdebug/tests/System/XDebugTestCase.php
+++ b/extensions/xdebug/tests/System/XDebugTestCase.php
@@ -19,10 +19,6 @@ class XDebugTestCase extends SystemTestCase
{
protected function setUp(): void
{
- if (getenv('SKIP_XDEBUG_TESTS')) {
- $this->markTestSkipped('Tests disabled by CI.');
- }
-
if (!extension_loaded('xdebug')) {
$this->markTestSkipped('XDebug not enabled.');
}
diff --git a/extensions/xdebug/tests/Unit/XDebugUtilTest.php b/extensions/xdebug/tests/Unit/XDebugUtilTest.php
index 3360f5fda..1d5c17617 100644
--- a/extensions/xdebug/tests/Unit/XDebugUtilTest.php
+++ b/extensions/xdebug/tests/Unit/XDebugUtilTest.php
@@ -39,29 +39,15 @@ public function testGenerate($class, $subject, $expected): void
'className' => $class,
'methodName' => $subject,
];
- $xdebugUtil = new XDebugUtil('3.1.2', false);
- $result = $xdebugUtil->filenameFromContext(Invoke::new(ExecutionContext::class, $params));
+ $result = XDebugUtil::filenameFromContext(Invoke::new(ExecutionContext::class, $params));
$this->assertEquals(
$expected,
$result
);
}
- /**
- *
- * @dataProvider provideXdebugVersion
- */
- public function testCacheGrindExtension($xdebugVersion, $useCompression, $expectedExtension): void
- {
- $xdebugUtil = new XDebugUtil($xdebugVersion, $useCompression);
-
- $cacheGrindExtension = $xdebugUtil->getCachegrindExtensionOfGeneratedFile();
-
- $this->assertEquals($expectedExtension, $cacheGrindExtension);
- }
-
- public static function provideGenerate()
+ public function provideGenerate()
{
return [
[
@@ -76,13 +62,4 @@ public static function provideGenerate()
],
];
}
-
- public static function provideXdebugVersion(): array
- {
- return [
- ['2.8.1', false, '.cachegrind'],
- ['3.1.2', false, '.cachegrind'],
- ['3.1.2', true, '.cachegrind.gz']
- ];
- }
}
diff --git a/flake.lock b/flake.lock
deleted file mode 100644
index cd2e1b7e7..000000000
--- a/flake.lock
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "nodes": {
- "flake-parts": {
- "inputs": {
- "nixpkgs-lib": "nixpkgs-lib"
- },
- "locked": {
- "lastModified": 1772408722,
- "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=",
- "owner": "hercules-ci",
- "repo": "flake-parts",
- "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3",
- "type": "github"
- },
- "original": {
- "id": "flake-parts",
- "type": "indirect"
- }
- },
- "nixpkgs": {
- "locked": {
- "lastModified": 1772615108,
- "narHash": "sha256-lC0KbklwgeSqS+sTkaYpnSYr/HDeVMzYUZqV/dT31Lo=",
- "owner": "NixOS",
- "repo": "nixpkgs",
- "rev": "0c39f3b5a9a234421d4ad43ab9c7cf64840172d0",
- "type": "github"
- },
- "original": {
- "owner": "NixOS",
- "ref": "nixpkgs-unstable",
- "repo": "nixpkgs",
- "type": "github"
- }
- },
- "nixpkgs-lib": {
- "locked": {
- "lastModified": 1772328832,
- "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=",
- "owner": "nix-community",
- "repo": "nixpkgs.lib",
- "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742",
- "type": "github"
- },
- "original": {
- "owner": "nix-community",
- "repo": "nixpkgs.lib",
- "type": "github"
- }
- },
- "root": {
- "inputs": {
- "flake-parts": "flake-parts",
- "nixpkgs": "nixpkgs"
- }
- }
- },
- "root": "root",
- "version": 7
-}
diff --git a/flake.nix b/flake.nix
deleted file mode 100644
index 354e90eba..000000000
--- a/flake.nix
+++ /dev/null
@@ -1,58 +0,0 @@
-# this is a WIP flake for development and experimentation only
-{
- description = "phpbench/phpbench";
-
- inputs = {
- nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
- };
-
- outputs = inputs @ {
- self,
- flake-parts,
- ...
- }:
- flake-parts.lib.mkFlake {inherit inputs;} {
- # This flake is for Linux (x86) and Apple (darwin) systems
- # If you need more systems, inspect `nixpkgs.lib.systems.flakeExposed` and
- # add them to this list.
- #
- # $ nix repl ""
- # nix-repl> lib.systems.flakeExposed
- systems = ["x86_64-linux" "aarch64-linux"];
-
- perSystem = {
- pkgs,
- system,
- ...
- }: let
- php = (pkgs.php85.buildEnv {
- extensions = ({ enabled, all }: enabled ++ (with all; [
- ]));
- extraConfig = ''
- '';
- });
- in {
- # Run `nix fmt` to reformat the nix files
- formatter = pkgs.alejandra;
-
- # Run `nix develop` to enter the development shell
- devShells.default = pkgs.mkShellNoCC {
- name = "php-devshell";
-
- buildInputs = [
- pkgs.bash
- pkgs.python3
- pkgs.php85.packages.composer
- php
- ];
- shellHook = ''
- if [ ! -d ".venv" ]; then
- python3 -m venv .venv;
- fi
- source .venv/bin/activate;
- (cd docs && pip install -r requirements.txt);
- '';
- };
- };
- };
-}
diff --git a/lib/Assertion/AssertionProcessor.php b/lib/Assertion/AssertionProcessor.php
index 2cbd7f34b..4bb31301d 100644
--- a/lib/Assertion/AssertionProcessor.php
+++ b/lib/Assertion/AssertionProcessor.php
@@ -23,8 +23,43 @@
class AssertionProcessor
{
- public function __construct(private readonly ExpressionLanguage $expressionLanaugage, private readonly Evaluator $evaluator, private readonly Printer $printer, private readonly EvaluatingPrinter $evaluatingPrinter, private readonly ParameterProvider $provider)
- {
+ /**
+ * @var Evaluator
+ */
+ private $evaluator;
+
+ /**
+ * @var Printer
+ */
+ private $printer;
+
+ /**
+ * @var ParameterProvider
+ */
+ private $provider;
+
+ /**
+ * @var EvaluatingPrinter
+ */
+ private $evaluatingPrinter;
+
+ /**
+ * @var ExpressionLanguage
+ */
+ private $expressionLanaugage;
+
+ public function __construct(
+ ExpressionLanguage $expressionLanaugage,
+ Evaluator $evaluator,
+ Printer $printer,
+ EvaluatingPrinter $evaluatingPrinter,
+ ParameterProvider $provider
+ ) {
+ $this->evaluator = $evaluator;
+ $this->printer = $printer;
+ $this->provider = $provider;
+ $this->evaluatingPrinter = $evaluatingPrinter;
+ $this->expressionLanaugage = $expressionLanaugage;
}
public function assert(Variant $variant, string $assertion): AssertionResult
@@ -54,7 +89,7 @@ public function assert(Variant $variant, string $assertion): AssertionResult
throw new AssertionError(sprintf(
'Assertion expression must evaluate to a boolean-like value, got "%s" as "%s"',
- $evaluated::class,
+ get_class($evaluated),
$this->printer->print($evaluated)
));
}
diff --git a/lib/Assertion/AssertionResult.php b/lib/Assertion/AssertionResult.php
index 7ec2cdd4a..6775ec4db 100644
--- a/lib/Assertion/AssertionResult.php
+++ b/lib/Assertion/AssertionResult.php
@@ -14,12 +14,24 @@
class AssertionResult
{
- final public const TOLERATED = 'tolerated';
- final public const FAIL = 'fail';
- final public const OK = 'ok';
+ public const TOLERATED = 'tolerated';
+ public const FAIL = 'fail';
+ public const OK = 'ok';
- public function __construct(private readonly string $type, private readonly ?string $message = null)
+ /**
+ * @var string
+ */
+ private $type;
+
+ /**
+ * @var string|null
+ */
+ private $message;
+
+ public function __construct(string $type, ?string $message = null)
{
+ $this->type = $type;
+ $this->message = $message;
}
public static function tolerated(string $message = ''): self
diff --git a/lib/Assertion/VariantAssertionResults.php b/lib/Assertion/VariantAssertionResults.php
index 58bcd0982..79f21cac1 100644
--- a/lib/Assertion/VariantAssertionResults.php
+++ b/lib/Assertion/VariantAssertionResults.php
@@ -12,7 +12,6 @@
namespace PhpBench\Assertion;
-use Countable;
use ArrayIterator;
use IteratorAggregate;
use PhpBench\Model\Variant;
@@ -20,18 +19,25 @@
/**
* @implements IteratorAggregate
*/
-class VariantAssertionResults implements IteratorAggregate, Countable
+class VariantAssertionResults implements IteratorAggregate, \Countable
{
+ /**
+ * @var Variant
+ */
+ private $variant;
+
/**
* @var array
*/
- private array $results = [];
+ private $results = [];
/**
* @param array $results
*/
- public function __construct(private readonly Variant $variant, array $results = [])
+ public function __construct(Variant $variant, array $results = [])
{
+ $this->variant = $variant;
+
foreach ($results as $result) {
$this->add($result);
}
@@ -42,7 +48,7 @@ public function __construct(private readonly Variant $variant, array $results =
*/
public function getIterator(): ArrayIterator
{
- return new ArrayIterator($this->results);
+ return new \ArrayIterator($this->results);
}
public function add(AssertionResult $result): void
diff --git a/lib/Attributes/Assert.php b/lib/Attributes/Assert.php
index 8df81fc74..1a58252bb 100644
--- a/lib/Attributes/Assert.php
+++ b/lib/Attributes/Assert.php
@@ -4,7 +4,7 @@
use Attribute;
-#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
+#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
class Assert
{
/**
diff --git a/lib/Attributes/Format.php b/lib/Attributes/Format.php
index c0641f83c..09bdd76af 100644
--- a/lib/Attributes/Format.php
+++ b/lib/Attributes/Format.php
@@ -2,8 +2,6 @@
namespace PhpBench\Attributes;
-use Attribute;
-
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
class Format
{
diff --git a/lib/Attributes/Groups.php b/lib/Attributes/Groups.php
index 6e02e3569..300632f02 100644
--- a/lib/Attributes/Groups.php
+++ b/lib/Attributes/Groups.php
@@ -17,10 +17,16 @@
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final class Groups
{
+ /**
+ * @var string[]
+ */
+ public $groups;
+
/**
* @param string[] $groups
*/
- public function __construct(public array $groups)
+ public function __construct(array $groups)
{
+ $this->groups = $groups;
}
}
diff --git a/lib/Attributes/Iterations.php b/lib/Attributes/Iterations.php
index 8f6c06e9c..9fa83a708 100644
--- a/lib/Attributes/Iterations.php
+++ b/lib/Attributes/Iterations.php
@@ -22,9 +22,6 @@ class Iterations
*/
public $iterations;
- /**
- * @param int|int[] $iterations
- */
public function __construct(int | array $iterations)
{
$this->iterations = (array)$iterations;
diff --git a/lib/Attributes/OutputMode.php b/lib/Attributes/OutputMode.php
index ad56cec43..8d114ca0a 100644
--- a/lib/Attributes/OutputMode.php
+++ b/lib/Attributes/OutputMode.php
@@ -17,13 +17,16 @@
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
class OutputMode
{
- public function __construct(private readonly string $mode)
+ /**
+ * @var string
+ */
+ private $mode;
+
+ public function __construct(string $mode)
{
+ $this->mode = $mode;
}
- /**
- * @return string
- */
public function getMode()
{
return $this->mode;
diff --git a/lib/Attributes/RetryThreshold.php b/lib/Attributes/RetryThreshold.php
index f554a7bf3..39c22b18a 100644
--- a/lib/Attributes/RetryThreshold.php
+++ b/lib/Attributes/RetryThreshold.php
@@ -2,12 +2,16 @@
namespace PhpBench\Attributes;
-use Attribute;
-
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final class RetryThreshold
{
- public function __construct(public int|float $retryThreshold)
+ /**
+ * @var int
+ */
+ public $retryThreshold;
+
+ public function __construct(int|float $retryThreshold)
{
+ $this->retryThreshold = $retryThreshold;
}
}
diff --git a/lib/Attributes/Sleep.php b/lib/Attributes/Sleep.php
index f529c7d28..b236bead4 100644
--- a/lib/Attributes/Sleep.php
+++ b/lib/Attributes/Sleep.php
@@ -7,7 +7,13 @@
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final class Sleep
{
- public function __construct(public int $sleep)
+ /**
+ * @var int
+ */
+ public $sleep;
+
+ public function __construct(int $sleep)
{
+ $this->sleep = $sleep;
}
}
diff --git a/lib/Attributes/Timeout.php b/lib/Attributes/Timeout.php
index d0f1aea8b..707d9e755 100644
--- a/lib/Attributes/Timeout.php
+++ b/lib/Attributes/Timeout.php
@@ -7,7 +7,13 @@
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final class Timeout
{
- public function __construct(public float $timeout)
+ /**
+ * @var float
+ */
+ public $timeout;
+
+ public function __construct(float $timeout)
{
+ $this->timeout = $timeout;
}
}
diff --git a/lib/Benchmark/Baseline/Baselines.php b/lib/Benchmark/Baseline/Baselines.php
index 4e465ca2a..e7276b037 100644
--- a/lib/Benchmark/Baseline/Baselines.php
+++ b/lib/Benchmark/Baseline/Baselines.php
@@ -12,19 +12,16 @@
namespace PhpBench\Benchmark\Baseline;
-use RuntimeException;
-
/**
* Class providing some static methods which are used
* to provide base line measurements.
*
+ * @see \PhpBench\Benchmark\BaselineManager
*/
class Baselines
{
/**
* Do nothing.
- *
- * @param int $revs
*/
public static function nothing($revs): void
{
@@ -34,8 +31,6 @@ public static function nothing($revs): void
/**
* Calculate an md5 hash.
- *
- * @param int $revs
*/
public static function md5($revs): void
{
@@ -48,22 +43,12 @@ public static function md5($revs): void
/**
* Open a file, write a string to it $revs times, then
* read each line back.
- *
- * @param int $revs
*/
public static function fwriteFread($revs): void
{
$tempName = tempnam(sys_get_temp_dir(), 'phpbench_baseline');
-
- if ($tempName === false) {
- throw new RuntimeException('Failed to create a temp file');
- }
$handle = fopen($tempName, 'w');
- if ($handle === false) {
- throw new RuntimeException(sprintf('Temp file %s is not writeable', $tempName));
- }
-
for ($i = 0; $i < $revs; $i++) {
fwrite($handle, 'lorum ipsum');
}
@@ -72,10 +57,6 @@ public static function fwriteFread($revs): void
$handle = fopen($tempName, 'r');
- if ($handle === false) {
- throw new RuntimeException(sprintf('Temp file %s is not readable', $tempName));
- }
-
$line = true;
while ($line) {
diff --git a/lib/Benchmark/BenchmarkFinder.php b/lib/Benchmark/BenchmarkFinder.php
index c8e5acf9d..59cf8f67f 100644
--- a/lib/Benchmark/BenchmarkFinder.php
+++ b/lib/Benchmark/BenchmarkFinder.php
@@ -12,14 +12,12 @@
namespace PhpBench\Benchmark;
-use InvalidArgumentException;
use Generator;
use PhpBench\Benchmark\Metadata\BenchmarkMetadata;
use PhpBench\Benchmark\Metadata\MetadataFactory;
-use Symfony\Component\Filesystem\Path;
-use Psr\Log\LoggerInterface;
use SplFileInfo;
use Symfony\Component\Finder\Finder;
+use Webmozart\PathUtil\Path;
/**
* This class finds a benchmark (or benchmarks depending on the path), loads
@@ -27,12 +25,20 @@
*/
class BenchmarkFinder
{
- public function __construct(
- private readonly MetadataFactory $factory,
- private readonly string $cwd,
- private readonly LoggerInterface $logger,
- private readonly ?string $benchPattern = null
- ) {
+ /**
+ * @var MetadataFactory
+ */
+ private $factory;
+
+ /**
+ * @var string
+ */
+ private $cwd;
+
+ public function __construct(MetadataFactory $factory, string $cwd)
+ {
+ $this->factory = $factory;
+ $this->cwd = $cwd;
}
/**
@@ -72,8 +78,6 @@ public function findBenchmarks(array $paths, array $subjectFilter = [], array $g
}
/**
- * @param string[] $paths
- *
* @return Generator
*/
private function findFiles(array $paths): Generator
@@ -85,7 +89,7 @@ private function findFiles(array $paths): Generator
$path = Path::makeAbsolute($path, $this->cwd);
if (!file_exists($path)) {
- throw new InvalidArgumentException(sprintf(
+ throw new \InvalidArgumentException(sprintf(
'File or directory "%s" does not exist (cwd: %s)',
$path,
$this->cwd
@@ -94,7 +98,7 @@ private function findFiles(array $paths): Generator
if (is_dir($path)) {
$search = true;
- $finder->in($path)->name($this->benchPattern ?? '*.php');
+ $finder->in($path)->name('*.php');
continue;
}
@@ -111,15 +115,6 @@ private function findFiles(array $paths): Generator
}
foreach ($finder as $file) {
- if ($this->benchPattern === null && !str_ends_with($file->getFilename(), 'Bench.php')) {
- $this->logger->warning(sprintf(
- 'File "%s" has been identified as a benchmark file but it does not end with ' .
- '`Bench.php`. This behavior is incorrect and will be fixed in a future version. ' .
- 'Set `runner.file_pattern` to `*Bench.php` in `phpbench.json` to avoid this.',
- $file->getFilename()
- ));
- }
-
yield $file;
}
}
diff --git a/lib/Benchmark/CartesianParameterIterator.php b/lib/Benchmark/CartesianParameterIterator.php
index 61ca7a2e6..53d905413 100644
--- a/lib/Benchmark/CartesianParameterIterator.php
+++ b/lib/Benchmark/CartesianParameterIterator.php
@@ -12,49 +12,35 @@
namespace PhpBench\Benchmark;
-use ArrayIterator;
-use Iterator;
-use PhpBench\Model\ParameterContainer;
use PhpBench\Model\ParameterSet;
-use PhpBench\Model\ParameterSetsCollection;
-/**
- * @implements Iterator
- */
-class CartesianParameterIterator implements Iterator
+class CartesianParameterIterator implements \Iterator
{
- /**
- * @var array>
- */
- private array $sets = [];
-
- private int $index = 0;
-
- private readonly int $max;
+ private $sets = [];
+ private $index = 0;
+ private $max;
+ private $current = [];
+ private $break = false;
/**
- * @var array
+ * @var string
*/
- private array $current = [];
-
- private bool $break = false;
-
- private string $key;
+ private $key;
- public function __construct(ParameterSetsCollection $parameterSetsCollection)
+ public function __construct(array $parameterSets)
{
- foreach ($parameterSetsCollection as $parameterSets) {
- $this->sets[] = $parameterSets->getIterator();
+ foreach ($parameterSets as $parameterSet) {
+ $this->sets[] = new \ArrayIterator($parameterSet);
}
- if (0 === $parameterSetsCollection->count()) {
+ if (empty($parameterSets)) {
$this->break = true;
}
- $this->max = count($parameterSetsCollection) - 1;
+ $this->max = count($parameterSets) - 1;
}
- public function current(): ParameterSet
+ public function current()
{
return $this->getParameterSet();
}
@@ -107,9 +93,10 @@ private function update(): void
$key = [];
foreach ($this->sets as $set) {
- /** @var ParameterSet|null $current */
- $current = $set->current();
- $this->current = array_merge($this->current, $current ? $current->toArray() : []);
+ $this->current = array_merge(
+ $this->current,
+ $set->current() ?: []
+ );
$key[] = $set->key();
}
$this->key = implode(',', $key);
@@ -117,6 +104,6 @@ private function update(): void
private function getParameterSet(): ParameterSet
{
- return ParameterSet::fromParameterContainers($this->key, $this->current);
+ return new ParameterSet($this->key, $this->current);
}
}
diff --git a/lib/Benchmark/Exception/StopOnErrorException.php b/lib/Benchmark/Exception/StopOnErrorException.php
index e51debc32..143fac862 100644
--- a/lib/Benchmark/Exception/StopOnErrorException.php
+++ b/lib/Benchmark/Exception/StopOnErrorException.php
@@ -12,8 +12,6 @@
namespace PhpBench\Benchmark\Exception;
-use Exception;
-
-class StopOnErrorException extends Exception
+class StopOnErrorException extends \Exception
{
}
diff --git a/lib/Benchmark/Metadata/AnnotationReader.php b/lib/Benchmark/Metadata/AnnotationReader.php
index 9a936e13b..8ed36ab92 100644
--- a/lib/Benchmark/Metadata/AnnotationReader.php
+++ b/lib/Benchmark/Metadata/AnnotationReader.php
@@ -13,28 +13,9 @@
namespace PhpBench\Benchmark\Metadata;
use Doctrine\Common\Annotations\AnnotationException;
+use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Annotations\DocParser;
use Doctrine\Common\Annotations\TokenParser;
-use PhpBench\Benchmark\Metadata\Annotations\AfterClassMethods;
-use PhpBench\Benchmark\Metadata\Annotations\AfterMethods;
-use PhpBench\Benchmark\Metadata\Annotations\Assert;
-use PhpBench\Benchmark\Metadata\Annotations\BeforeClassMethods;
-use PhpBench\Benchmark\Metadata\Annotations\BeforeMethods;
-use PhpBench\Benchmark\Metadata\Annotations\Executor;
-use PhpBench\Benchmark\Metadata\Annotations\Format;
-use PhpBench\Benchmark\Metadata\Annotations\Groups;
-use PhpBench\Benchmark\Metadata\Annotations\Iterations;
-use PhpBench\Benchmark\Metadata\Annotations\OutputMode;
-use PhpBench\Benchmark\Metadata\Annotations\OutputTimeUnit;
-use PhpBench\Benchmark\Metadata\Annotations\ParamProviders;
-use PhpBench\Benchmark\Metadata\Annotations\RetryThreshold;
-use PhpBench\Benchmark\Metadata\Annotations\Revs;
-use PhpBench\Benchmark\Metadata\Annotations\Skip;
-use PhpBench\Benchmark\Metadata\Annotations\Sleep;
-use PhpBench\Benchmark\Metadata\Annotations\Subject;
-use PhpBench\Benchmark\Metadata\Annotations\Timeout;
-use PhpBench\Benchmark\Metadata\Annotations\Warmup;
-use PhpBench\Benchmark\Metadata\Exception\CouldNotLoadMetadataException;
use PhpBench\Reflection\ReflectionClass;
use PhpBench\Reflection\ReflectionMethod;
@@ -43,34 +24,32 @@
*/
class AnnotationReader
{
- /** @var array> */
- private array $useImports = [];
-
- /** @var array */
- private static array $phpBenchImports = [
- 'BeforeMethods' => BeforeMethods::class,
- 'BeforeClassMethods' => BeforeClassMethods::class,
- 'AfterMethods' => AfterMethods::class,
- 'AfterClassMethods' => AfterClassMethods::class,
- 'ParamProviders' => ParamProviders::class,
- 'Groups' => Groups::class,
- 'Iterations' => Iterations::class,
- 'Revs' => Revs::class,
- 'Skip' => Skip::class,
- 'Sleep' => Sleep::class,
- 'OutputTimeUnit' => OutputTimeUnit::class,
- 'OutputMode' => OutputMode::class,
- 'Warmup' => Warmup::class,
- 'Subject' => Subject::class,
- 'Assert' => Assert::class,
- 'Executor' => Executor::class,
- 'Timeout' => Timeout::class,
- 'Format' => Format::class,
- 'RetryThreshold' => RetryThreshold::class,
+ private $useImports = [];
+ private $importUse = false;
+
+ private static $phpBenchImports = [
+ 'BeforeMethods' => Annotations\BeforeMethods::class,
+ 'BeforeClassMethods' => Annotations\BeforeClassMethods::class,
+ 'AfterMethods' => Annotations\AfterMethods::class,
+ 'AfterClassMethods' => Annotations\AfterClassMethods::class,
+ 'ParamProviders' => Annotations\ParamProviders::class,
+ 'Groups' => Annotations\Groups::class,
+ 'Iterations' => Annotations\Iterations::class,
+ 'Revs' => Annotations\Revs::class,
+ 'Skip' => Annotations\Skip::class,
+ 'Sleep' => Annotations\Sleep::class,
+ 'OutputTimeUnit' => Annotations\OutputTimeUnit::class,
+ 'OutputMode' => Annotations\OutputMode::class,
+ 'Warmup' => Annotations\Warmup::class,
+ 'Subject' => Annotations\Subject::class,
+ 'Assert' => Annotations\Assert::class,
+ 'Executor' => Annotations\Executor::class,
+ 'Timeout' => Annotations\Timeout::class,
+ 'Format' => Annotations\Format::class,
+ 'RetryThreshold' => Annotations\RetryThreshold::class,
];
- /** @var array */
- private static array $globalIgnoredNames = [
+ private static $globalIgnoredNames = [
// Annotation tags
'Annotation' => true, 'Attribute' => true, 'Attributes' => true,
/* Can we enable this? 'Enum' => true, */
@@ -113,13 +92,6 @@ class AnnotationReader
'after' => true,
'afterClass' => true,
'backupGlobals' => true,
- 'template' => true,
- 'template-covariant' => true,
- 'template-contravariant' => true,
- 'use' => true,
- 'implements' => true,
- 'extends' => true,
- 'param-out' => true,
'backupStaticAttributes' => true,
'before' => true,
'beforeClass' => true,
@@ -155,35 +127,40 @@ class AnnotationReader
'startuml' => true, 'enduml' => true,
];
- private readonly DocParser $docParser;
+ /**
+ * @var DocParser
+ */
+ private $docParser;
/**
* Set import use to true in order to use imported annotations, otherwise
* import the PHPBench annotations directly.
*
*/
- public function __construct(private readonly bool $importUse = false)
+ public function __construct(bool $importUse = false)
{
$this->docParser = new DocParser();
$this->docParser->setIgnoredAnnotationNames(self::$globalIgnoredNames);
+ $this->importUse = $importUse;
+
+ AnnotationRegistry::registerLoader(function ($classFqn) {
+ if (class_exists($classFqn)) {
+ return true;
+ }
+ });
}
/**
* Return annotations for the given class.
- *
- * @return list]