Skip to content

Keep the restart ini out of the container key - #6834

Merged
ondrejmirtes merged 1 commit into
phpstan:2.3.xfrom
SanderMuller:container-key-ignore-restart-env
Oct 25, 2026
Merged

ondrejmirtes merged 1 commit into
phpstan:2.3.xfrom
SanderMuller:container-key-ignore-restart-env

Conversation

@SanderMuller

Copy link
Copy Markdown
Contributor

The restart points PHPRC at a temporary ini with a random name, and it empties PHP_INI_SCAN_DIR. The container key includes the environment, apart from a few named variables, so each run that restarts this way builds a new container. A warm run pays for that every time.

PHPStan 2.3.2 at level 5 on Rector's rules/ (759 files), against the same phar with this change patched in:

2.3.2 patched
containers built in 13 runs (1 cold, 12 warm), GitHub runner 13 1
warm wall time, GitHub runner, PHP 8.4, median of 10 1.64 s 1.20 s
warm wall time, M4 Pro, PHP 8.5, median of 15 1.03 s 0.81 s

Both report the same 2,684 errors. Rector restarts through the same code, and its warm runs on the runner go from 0.91–0.92 s to 0.65–0.66 s.

#5927 would also cover this, because it keys the container only on the variables a config references. This change is the narrow version for the two variables the restart sets.

🤖 Generated with Claude Code

The restart points PHPRC at a temporary ini with a random name and empties
PHP_INI_SCAN_DIR. The container key includes the environment, so each
restarted run built a new container.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ondrejmirtes
ondrejmirtes merged commit a51e744 into phpstan:2.3.x Oct 25, 2026
994 of 995 checks passed
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants