Repository navigation
Let TurboProcessRestarter restart without OPcache - #6837
Closed
SanderMuller wants to merge 1 commit into
Closed
SanderMuller wants to merge 1 commit into
SanderMuller wants to merge 1 commit into
Conversation
A program that loads PHPStan, Rector for example, can now pass $withOpcache false. The restart then does the same work for Turbo, xdebug, pcov, uopz and Tideways, but leaves OPcache dormant. The default does not change. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Member
|
I feel like we don't need to give this option. Cold runs are faster with OPCache, and we might be able to make warm runs faster later with a daemon process. It's not like we have the data about whether the run will be warm or cold at that point to decide "do we want OPCache or not?". |
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.
This adds an optional
$withOpcacheparameter toTurboProcessRestarter::restartIfSuitable(). Withfalse, the restart still loads Turbo and disarms xdebug, pcov and uopz, but it does not turn on OPcache. The default does not change.This is for Rector, where a warm run is slower with OPcache on. In a warm run, the main process compiles each file it loads once and then exits. Forked workers turn OPcache off, so only the main process uses it.
PHPStan keeps OPcache, because it helps a cold run. I measured PHPStan 2.3.2 (with #6834) on GitHub runners, on 1252 files of Rector's own code at level 5. The only change between the two arms is the
opcacherestart reason. A cold run has no result cache, and a run without tmpDir also builds the container. Medians:#6634 tries to keep the cold gain without the warm cost. I have not measured it on cold runs yet.
Both arms report the same errors. The new e2e row runs PHPStan through a wrapper that restarts with
$withOpcachefalse. It checks that one restart disarms pcov and that OPcache stays off. I ran the same check locally with xdebug as the restart reason. Without the change, it fails onrestarted-forandopcache-cli-on.🤖 Generated with Claude Code