Skip to content

Preserve PHPStan result cache between playground-runner invocations#14775

Open
iliaal wants to merge 1 commit into
phpstan:2.2.xfrom
iliaal:perf/playground-runner-preserve-cache
Open

Preserve PHPStan result cache between playground-runner invocations#14775
iliaal wants to merge 1 commit into
phpstan:2.2.xfrom
iliaal:perf/playground-runner-preserve-cache

Conversation

@iliaal
Copy link
Copy Markdown

@iliaal iliaal commented Jun 5, 2026

Before: clearTemp() recursively deletes everything under /tmp on every Lambda invocation, including PHPStan's result cache.
After: it removes only this request's input files (/tmp/tmp.php, /tmp/run-phpstan-tmp.neon); the cache survives.
Why: on a warm Lambda the full wipe forces PHPStan to rebuild its cache on every analysis. The cache is keyed on file content and config, so reusing the /tmp/tmp.php path across requests still yields correct results, and isolation holds because both user-content files are overwritten each request.

I couldn't exercise the deployed Lambda from the repo; verified by reading and php -l. Worth a sanity check on staging that the cache dir under /tmp is the one the container factory reuses.

clearTemp() recursively deleted everything under /tmp on every invocation,
including PHPStan's result cache. On a warm Lambda that forced a full cache
rebuild on each analysis. Delete only this request's input files (tmp.php and
run-phpstan-tmp.neon) instead; the cache is keyed on file content and config,
so the reused paths still produce correct results.
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.

1 participant