You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cache hot perfomance regression on 2.1.32 -> 2.2.6 #15011
Our repository has huge baseline profile, Maybe that's the reason.
Regenerate baseline on 2.1.32 -> 2.2.6 migration, Maybe that's the reason.
I'll reply if there are any updates.
Code snippet that reproduces the problem
No response
Expected output
faster than 2.1.32 on cache hot
Did PHPStan help you today? Did it make you happy in any way?
PHPStan is an absolutely essential tool that supports the stable operation of our projects. We would like to express our deepest gratitude for providing this tool and for your commitment to incorporating aggressive improvements through PHPStan Turbo. Thank you!
On whether Turbo is involved: your own table already rules it out. In the cache-hit rows the regression is fully present with Turbo OFF (2.1.32 14.6s vs 2.2.6 24.2s, +66%), and turning Turbo on shifts the warm number by only a few percent (24.2 off vs 24.9 / 23.5 on). Turbo's real win is cold-only (+21.8%). So this is a regression in stock PHPStan's warm path, not Turbo. That fits how Turbo works too: it mainly shadows analysis-engine classes, which a cache-hit run barely exercises.
I tried to reproduce it and could not on a smaller corpus. On a doctrine/symfony codebase (~4.5k files) stock 2.2.6 cache-hit is about 2x faster than 2.1.32, not slower, and resultCache.php itself grew only ~1.1x between the two versions. So this is not a universal warm-path change; it is specific to larger setups like yours.
The interesting part is the shape of your numbers: 2.2.6 is much faster cold (855 -> 436s, -49%) but slower warm (+66%). That is what you would expect if 2.2.6 does more per-run setup (there was quite a bit of new dependency and exported-node tracking in this window) which pays for itself during a full analysis but is the entire cost of a cache-hit run, where there is nothing left to analyse. That only becomes visible at your scale, which is why a small corpus shows the opposite.
Fastest way to localize it without your codebase: run analyse -vvv cache-hit on both 2.1.32 and 2.2.6 and compare where the time goes (cache restore vs dependency processing vs the rest), plus the size of resultCache.php on each. If you can share that split it should point straight at the phase that grew. A git bisect across the result-cache commits between 2.1.32 and 2.2.6 would pin the exact commit if you have the appetite for it.
Activity
mergeable commentedon Jul 28, 2026
This bug report is missing a link to reproduction at phpstan.org/try.
It will most likely be closed after manual review.
ondrejmirtes commentedon Jul 28, 2026
Have you tried switching to the PHP baseline format? https://phpstan.org/user-guide/baseline#php-baseline-format-instead-of-neon
zeriyoshi commentedon Jul 28, 2026
@ondrejmirtes
Yes. We used php style baseline format.
SanderMuller commentedon Jul 31, 2026
On whether Turbo is involved: your own table already rules it out. In the cache-hit rows the regression is fully present with Turbo OFF (2.1.32 14.6s vs 2.2.6 24.2s, +66%), and turning Turbo on shifts the warm number by only a few percent (24.2 off vs 24.9 / 23.5 on). Turbo's real win is cold-only (+21.8%). So this is a regression in stock PHPStan's warm path, not Turbo. That fits how Turbo works too: it mainly shadows analysis-engine classes, which a cache-hit run barely exercises.
I tried to reproduce it and could not on a smaller corpus. On a doctrine/symfony codebase (~4.5k files) stock 2.2.6 cache-hit is about 2x faster than 2.1.32, not slower, and
resultCache.phpitself grew only ~1.1x between the two versions. So this is not a universal warm-path change; it is specific to larger setups like yours.The interesting part is the shape of your numbers: 2.2.6 is much faster cold (855 -> 436s, -49%) but slower warm (+66%). That is what you would expect if 2.2.6 does more per-run setup (there was quite a bit of new dependency and exported-node tracking in this window) which pays for itself during a full analysis but is the entire cost of a cache-hit run, where there is nothing left to analyse. That only becomes visible at your scale, which is why a small corpus shows the opposite.
Fastest way to localize it without your codebase: run
analyse -vvvcache-hit on both 2.1.32 and 2.2.6 and compare where the time goes (cache restore vs dependency processing vs the rest), plus the size ofresultCache.phpon each. If you can share that split it should point straight at the phase that grew. A git bisect across the result-cache commits between 2.1.32 and 2.2.6 would pin the exact commit if you have the appetite for it.