dantleech / phpbench
PHP Benchmarking Framework
Fund package maintenance!
dantleech
Installs: 317
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1 886
Watchers: 32
Forks: 122
Open Issues: 31
Requires
- php: ^8.1
- ext-dom: *
- ext-json: *
- ext-pcre: *
- ext-reflection: *
- ext-spl: *
- ext-tokenizer: *
- doctrine/annotations: ^2.0
- phpbench/container: ^2.2
- phpbench/dom: ~0.3.3
- psr/log: ^1.1 || ^2.0 || ^3.0
- seld/jsonlint: ^1.1
- symfony/console: ^6.1 || ^7.0
- symfony/filesystem: ^6.1 || ^7.0
- symfony/finder: ^6.1 || ^7.0
- symfony/options-resolver: ^6.1 || ^7.0
- symfony/process: ^6.1 || ^7.0
- webmozart/glob: ^4.6
Requires (Dev)
- dantleech/invoke: ^2.0
- ergebnis/composer-normalize: ^2.39
- friendsofphp/php-cs-fixer: ^3.0
- jangregor/phpstan-prophecy: ^1.0
- phpspec/prophecy: dev-master
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^10.4
- rector/rector: ^0.18.11 || ^1.0.0
- symfony/error-handler: ^6.1 || ^7.0
- symfony/var-dumper: ^6.1 || ^7.0
Suggests
- ext-xdebug: For Xdebug profiling extension.
- 1.3.1
- 1.3.0
- dev-master / 1.2.x-dev
- 1.2.15
- 1.2.14
- 1.2.13
- 1.2.12
- 1.2.11
- 1.2.10
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.x-dev
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.x-dev
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 1.0.0-beta2
- 1.0.0-beta1
- 1.0.0-alpha9
- 1.0.0-alpha8
- 1.0.0-alpha7
- 1.0.0-alpha6
- 1.0.0-alpha5
- 1.0.0-alpha4
- 1.0.0-alpha3
- 1.0.0-alpha2
- 1.0.0-alpha1
- 0.17.1
- 0.17.0
- 0.16.10
- 0.16.9
- 0.16.8
- 0.16.7
- 0.16.6
- 0.16.5
- 0.16.4
- 0.16.3
- 0.16.2
- 0.16.1
- 0.16.0
- 0.15.0
- 0.14.0
- 0.13.0
- 0.12.x-dev
- 0.12.2
- 0.12.1
- 0.12.0
- 0.11.x-dev
- 0.11.2
- 0.11.1
- 0.11.0
- 0.10.0
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.1
- 0.8.0
- 0.7.0
- 0.6
- 0.5
- 0.3
- 0.2.2
- 0.2.1
- 0.2
- 0.1
- dev-https
- dev-opcache-flag
- dev-dependabot/composer/phpunit/phpunit-tw-10.4or-tw-11.0
- dev-poc-opcode-counter
- dev-dependabot/github_actions/actions/setup-python-5
- dev-composer-lock-file
- dev-dependabot/github_actions/actions/checkout-4
- dev-json
- dev-program-executor
- dev-filter-by-variant
- dev-subject-executor-fixes
- dev-sum-and-count
- dev-gh-840-fix-incorrect-column-def
- dev-gh-832-datetime-string
- dev-iteration-rev-over
- dev-env-all
- dev-node-highlight
- dev-property-access-time-unit
- dev-assertion-dsl
- dev-doctrine-lexert
- dev-example-hrtime
- dev-refactoring_runner
- dev-develop
- dev-gh-releases
- dev-calibration
- dev-ping
- dev-subject_label
- dev-check_xsl_extension
- dev-xdebug_trace_sort
- dev-better_reflection
- dev-subject_name
- dev-pchart
- dev-composite_gen_fix
- dev-fix_skip
- dev-rmt
- dev-counterweight
- dev-bliken_spacing_fix
- dev-xml_storage
- dev-iterations_fix
- dev-faq
- dev-simple_logger
- dev-graphs
- dev-concurrent_runner
- dev-arg_params
This package is auto-updated.
Last update: 2024-10-05 14:58:27 UTC
README
PHPBench is a benchmark runner for PHP analogous to PHPUnit but for performance rather than correctness.
Features include:
- Revolutions: Repeat your code many times to determine average execution time.
- Iterations: Sample your revolutions many times and review aggregated statistical data.
- Process Isolation: Each iteration is executed in a separate process.
- Reporting: Customizable reports and various output formats (e.g. console, CSV, Markdown, HTML).
- Report storage and comparison: 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.
- Assertions: Assert that code is performing within acceptable limits, or that it has not regressed from a previously recorded baseline.
See the documentation to find out more.
Installation
composer require phpbench/phpbench --dev
See the installation instructions for more options.
Documentation
Documentation is hosted on readthedocs.
Community
- Follow @phpbench on Mastodon for the latest news.
- Join the
#phpbench
channel on the Slack Symfony Devs channel.
Screenshots
Running benchmarks and comparing against a baseline:
Aggregated report:
Blinken logger:
HTML Bar Chart:
Console Bar Chart:
Contributing
PHPBench is an open source project. If you find a problem or want to discuss new features or improvements please create an issue, and/or if possible create a pull request.