Uh oh!
There was an error while loading. Please reload this page.
SymfonyContainerResultCacheMetaExtension optimization - #488
Conversation
xificurk
commented
May 9, 2026
Measured on top of #487 (comment) In combination with the lazy maps, this PR eliminates the initialization of ServiceMap and ParameterMap in the main process as well, leading to further improvement (10 run median) 8.77s -> 8.18s on the same simple test |
Uh oh!
There was an error while loading. Please reload this page.
staabm
commented
May 13, 2026
atm we are focused on shipping the next phpstan release. I will comeback to this PR after the release is out |
Add simple filesytem cache for the DI container hash to avoid expensive parsing, normalizing and hashing of the whole DI container on each call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tainer regeneration
741b799 to
7627fcfCompareThere was a problem hiding this comment.
The cache busting strategy implemented by the extension attempts to avoid unnecessary invalidations by calculating the hash from the parsed parameters and services used within phpstan-symfony logic. This addresses the case when the container XML have been regenerated and changed, but not in an significant way impacting the result cache
I think we need a test in which the container is changed in a non-significant way, but the cache is still used
xificurk
commented
Jun 16, 2026
@staabm I can take a look at that, but want to be clear that what you quoted is the description of the current behavior present in the master. This MR is a performance optimization of that described strategy. |
staabm
left a comment
There was a problem hiding this comment.
I see. I am fine than. thanks for noting.
Uh oh!
There was an error while loading. Please reload this page.
staabm
commented
Jun 16, 2026
thanks anyone inolved! |
The cache busting strategy implemented by the extension attempts to avoid unnecessary invalidations by calculating the hash from the parsed parameters and services used within phpstan-symfony logic. This addresses the case when the container XML have been regenerated and changed, but not in an significant way impacting the result cache (originally discussed in #255).
The problem is that on large DI containers this parsing, normalizing and hashing is not exactly cheap:
This PR adds a simple filesytem cache for the calculated hash to avoid this cost - the hash is recalculated from the parsed services/parameters only when the underlying XML changes.