New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
slow analysis on big literal array #7901
Comments
looking at a profile suggests, that the path to generalize the literal array is already slow, because too many elements involved to build the generalized key/value types https://blackfire.io/profiles/c96451ef-d390-451b-89ed-41189665c8c0/graph |
Fixed by: phpstan/phpstan-src@0cc87f3 |
my real world use-case with ~90.000 literal array values still takes 3-4 minutes using the latest dev-1.8. not sure this is worth investigating though. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
for some reason, we have a source file in the app which contains an array with ~90.000 literal strings.
analyzing this files takes phpstan a big amount of time:
Code snippet that reproduces the problem
simplified example, which takes ~1 second to analyze:
https://phpstan.org/r/a1ac48b5-11ac-4f53-b928-2f08bc54affeit seems my initial sample is a bit too small, because it was cut down by some tool involved.
here is a full script: https://gist.github.com/staabm/ea8b72c50c68648d48820bb7823e98b2
Expected output
faster analysis
The text was updated successfully, but these errors were encountered: