perf: Prefilter methods that cannot return QueryBuilder - #780
Draft
realFlowControl wants to merge 3 commits into
Draft
perf: Prefilter methods that cannot return QueryBuilder#780realFlowControl wants to merge 3 commits into
realFlowControl wants to merge 3 commits into
Conversation
Inspect declared method variants before argument-dependent selection and return early only when every variant definitely cannot return QueryBuilder. Uncertain, generic, mixed, and compatible variants continue through the existing resolution path. Most method candidates do not return QueryBuilder. This conservative filter avoids ParametersAcceptorSelector and downstream work for definite negatives while preserving fallback behavior whenever the declaration is not conclusive. Benchmark: uncached Sylius analysis of 2,366 files with eight workers, five runs per variant. Median elapsed time fell from 28.91 s to 28.45 s (-1.6%) and aggregate user+sys CPU from 176.22 s to 170.75 s (-3.1%).
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.
Inspect declared method variants before argument-dependent selection and return early only when every variant definitely cannot return
QueryBuilder. Uncertain, generic, mixed, and compatible variants continue through the existing resolution path.Most method candidates do not return
QueryBuilder. This conservative filter avoidsParametersAcceptorSelectorand downstream work for definite negatives while preserving fallback behavior whenever the declaration is not conclusive.Benchmark: uncached Sylius analysis of 2,366 files with eight workers, five runs per variant. Median elapsed time fell from 28.91 s to 28.45 s (-1.6%) and aggregate user+sys CPU from 176.22 s to 170.75 s (-3.1%).
Benchmark run locally using PHPStan 2.2.x and PHPStan-Doctrine 2.0.x on MacOS with PHP 8.5.7