Repository navigation
[perf] Run the workers with PHPStan Turbo - #8812
Open
SanderMuller wants to merge 3 commits into
Open
SanderMuller wants to merge 3 commits into
SanderMuller wants to merge 3 commits into
Conversation
SanderMuller
force-pushed
the
turbo-in-workers
branch
from
October 24, 2026 18:57
99cbdf9 to
b154595
Compare
Member
|
Thanks 👍 Can you add simple CI workflow that would run Rector on itself and show numbers before/after? So we have a reproducible bench to adhere to. |
Contributor
Author
I added the CI workflow, I'm still benchmarking locally if the main-process restart can/should be skipped, which will have impact on the warm benchmarks |
Contributor
Author
|
I added the Self Benchmark workflow. On this PR:
|
The new Self Benchmark workflow runs scripts/rector-ab-benchmark.php on Rector's own rules/ directory, first with the base branch and then with the pull request, and puts the A/B table in the job summary. The script now also reports the median CPU time, workers included.
The workers get Turbo on their command line, and they do the analysis. The restart cost every warm run time and gave no cold gain.
SanderMuller
force-pushed
the
turbo-in-workers
branch
from
October 25, 2026 20:30
250dcef to
2a43cf7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Runs Rector's workers with PHPStan Turbo, the native extension that ships with
phpstan/phpstan.WorkerCommandLineFactorypasses the extension to the workers with-d. The workers do the analysis, so the main process does not restart.bin/rectoractivates Turbo beforepreload.php, because Turbo replaces php-parser classes. When Rector is installed as a dependency,bin/rectorloads PHPStan's bootstrap early, because the project autoloader comes afterpreload.php.phpstan/phpstan^2.3.2forTurboExtensionSelector::EXTENSION_PATH_INI.rules/for the base and for the PR. The job summary shows both.--dry-runMedians of 5 interleaved runs per side, with Shopware's own
rector.php, on an M4 Pro with PHP 8.5. Every run gave the same 14 changed files.The first version of this PR also restarted the main process into Turbo. That made warm runs slower and cold runs no faster, so I removed it. Forking workers comes in a separate PR, and it will probably need the restart back.