Skip to content

Introduce phpbench benchmarks and profiles#1602

Merged
alganet merged 1 commit intomainfrom
phpbench
Jan 12, 2026
Merged

Introduce phpbench benchmarks and profiles#1602
alganet merged 1 commit intomainfrom
phpbench

Conversation

@alganet
Copy link
Member

@alganet alganet commented Jan 11, 2026

This commit is the first step in setting up Continuous Performance for the repository.

  • Adds phpbench/phpbench to dev dependencies.
  • Adds an initial ValidatorBench.php file with validate benchmarks for several validators.
  • Adds composer bench script to run benchmarks.
  • Adds composer bench:profile script to generate profiles.

phpbench can do much more than how it is currently configured, but these are future steps. For now, it can help developers to catch performance and memory usage regressions.

The composer bench:profile, in conjunction with tools like kcachegrind or webgrind, is particularly useful to find hotspots and do more detailed analysis.

Example benchmark profile loaded with kcachegrind:

Screenshot 2026-01-11 202749

@alganet alganet requested a review from Copilot January 11, 2026 23:45
@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.47%. Comparing base (6022914) to head (2c45f19).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1602      +/-   ##
============================================
+ Coverage     97.43%   97.47%   +0.04%     
- Complexity      981      993      +12     
============================================
  Files           211      211              
  Lines          2259     2299      +40     
============================================
+ Hits           2201     2241      +40     
  Misses           58       58              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces PHPBench benchmarking infrastructure to enable continuous performance monitoring. It adds the phpbench dependency, creates an initial benchmark suite for validators, and provides composer scripts to run benchmarks and generate performance profiles.

Changes:

  • Added phpbench/phpbench as a dev dependency
  • Created ValidatorBench.php with benchmarks for 70+ validators
  • Added composer scripts for running benchmarks and generating profiles

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.

File Description
tests/benchmark/ValidatorBench.php New benchmark file testing validation performance across multiple validators
phpbench.json Configuration file for phpbench runner settings
composer.json Added phpbench dependency and composer scripts for benchmarking
.gitignore Added phpbench cache directories to ignore list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alganet alganet self-assigned this Jan 11, 2026
@alganet alganet added this to the 3.0 milestone Jan 11, 2026
@alganet alganet requested a review from henriquemoody January 11, 2026 23:53
@alganet alganet marked this pull request as ready for review January 11, 2026 23:53
henriquemoody
henriquemoody previously approved these changes Jan 12, 2026
Copy link
Member

@henriquemoody henriquemoody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrote a few comments but having this here would be awesome as is

This commit is the first step in setting up *Continuous Performance*
for the repository.

 - Adds phpbench/phpbench to dev dependencies.
 - Adds an initial `ValidatorBench.php` file with validate benchmarks
   for several validators.
 - Adds `composer bench` script to run benchmarks.
 - Adds `composer bench:profile` script to generate profiles.
@alganet alganet merged commit abdc73b into main Jan 12, 2026
9 checks passed
@alganet alganet deleted the phpbench branch January 12, 2026 23:44
@alganet alganet mentioned this pull request Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants