Skip to content

Add A/B perf benchmark script - #8536

Open
TomasVotruba wants to merge 3 commits into
mainfrom
perf-cgroup-cpu-cap
Open

TomasVotruba wants to merge 3 commits into
mainfrom
perf-cgroup-cpu-cap

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

A/B perf benchmark script

scripts/rector-ab-benchmark.php measures the current checkout against a project (defaults to a shallow clone of laravel/laravel), reporting median cold and warm wall time, peak RSS, and a fingerprint of the changed-file set so a speed change that alters behavior is caught. Run it once per ref with --save / --baseline to compare two refs. It never switches git refs itself, so it is safe to run while other work happens in the repo.

Excluded from PHPStan like the sibling rector-jobsize-benchmark.php (shells out, parses getopt by hand).

I used it to check two ports of recent PHPStan speedups and both showed no measurable gain in Rector, so neither is included here:

  • stat-signature hash reuse (phpstan-src#6627): Rector already hashes with xxh128, so the file read it would skip is not a real cost (PHPStan's win was from sha256 over large files).
  • cgroup CPU-quota worker cap: correct in principle, but only moves the needle under a container quota, which this benchmark does not exercise.

@TomasVotruba TomasVotruba changed the title [Parallel] Cap worker count by cgroup CPU quota in containers Add A/B perf benchmark script Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant