Repository navigation
[perf] Restart without Xdebug before the container is built - #8713
Merged
TomasVotruba merged 1 commit intoOct 19, 2026
Merged
Conversation
XdebugHandler::check() ran in ConsoleApplication::doRun(), after bin/rector had loaded the configs and built the container. When Xdebug was loaded, the restarted process did that work again. The check now runs in bin/rector, right after the autoloaders. It still calls setPersistent() and is still skipped with --xdebug.
Member
|
Seems valid, the sooner we spot this the better 👍 |
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.
When Xdebug is loaded,
XdebugHandlerrestarts Rector without it. The check ran inConsoleApplication::doRun(), afterbin/rectorhad loaded the configs and built the container. The restarted process then did all of that work again.The check now runs in
bin/rector, right after the autoloaders and before the configs load. It still callssetPersistent()and is still skipped with--xdebug, so the behaviour from #5544 stays the same. Workers still start without Xdebug.I measured on an M4 Pro with Herd's PHP 8.5 and Xdebug in its default
developmode. All runs used a warm cache and--dry-run, with the two sides interleaved:src/Console, 10 runs per side: CPU median 1.15 s before, 0.76 s after. The ranges, 1.06 to 1.29 s and 0.71 to 0.83 s, do not overlap.rector.php, 10 runs per side: CPU median 4.98 s before, 4.15 s after. The machine was busy, so the ranges overlap. 7 of the 10 pairs were faster after the change.Each run gave the same output on both sides.
-v, the version alias, used to return before the check. With Xdebug loaded, it now restarts first and then prints the same version.