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
I was expecting it to be solved in v1.8.4 phpstan, but it seems the font files, mostly consisting of large arrays, are still not analysed effectively. The array shape is degraded probably not when parsing, and the full array shape is still built once which is very slow.
If a longer sample is needed, I've attached a txt file with the same class with 10k values that takes 66 seconds to analyse on my machine. Our codebase contains multiple of these maps, and since the upgrade we did from from 1.8.2 to 1.8.8, the CI pipelines times out.
Thanks for all the hard work you're putting into this project, it's absolutely amazing and a complete paradigm shift for php.
@bart-mollie the slowness in your example code is from analysing the array_search call. It's not the same issue, but perhaps some other examples from your codebase are. Please create a separate issue for this.
Let's keep this issue open until released. If ok, I will be happy to provide a regression test for it then as this caused a lot of trouble for me in the past. Thank you.
Activity
ondrejmirtes commentedon Sep 7, 2022
How does the performance compare in PHPStan 1.8.5?
mvorisek commentedon Sep 7, 2022
With phpstan v1.8.5 and fonts/ directory included, phpstan still does not finish.
enumag commentedon Oct 7, 2022
I finished my update from PHPStan 1.4 to PHPStan 1.8 and the CI runs time (when there is no result cache) went from ~24 mins to ~62 mins. 😳
ondrejmirtes commentedon Oct 7, 2022
@enumag This isn't helpful nor actionable. Run with
-vvv --debug, find which file takes the longest, isolate the problem, and open a separate issue.bart-mollie commentedon Oct 10, 2022
I'm running into a similar issue on my codebase, and have created a small sample here to show the structure that phpstan hangs on. The playground times out when the array contains about 2000 values. https://phpstan.org/r/46a17e15-22a3-414a-b8d7-c27617d5ac5b.
If a longer sample is needed, I've attached a txt file with the same class with 10k values that takes 66 seconds to analyse on my machine. Our codebase contains multiple of these maps, and since the upgrade we did from from
1.8.2to1.8.8, the CI pipelines times out.Thanks for all the hard work you're putting into this project, it's absolutely amazing and a complete paradigm shift for php.
HugeMapClass.php.txt
rvanvelzen commentedon Oct 10, 2022
@bart-mollie the slowness in your example code is from analysing the
array_searchcall. It's not the same issue, but perhaps some other examples from your codebase are. Please create a separate issue for this.bart-mollie commentedon Oct 10, 2022
Thanks for looking into it! I've created #8147
staabm commentedon Dec 12, 2022
@mvorisek could you double check with the latest development version?
if it is still slow, could you extract the actually slow files so I can reproduce easily?
you may utilize https://gist.github.com/ruudk/41897eb59ff497b271fc9fa3c7d5fb27
mvorisek commentedon Dec 12, 2022
feel free to test on TCPDF repo directly or with mvorisek/TCPDF@a458bc1 with https://github.com/mvorisek/TCPDF/blob/a458bc1e61bcf5a2060b78164e57619d0f6569cc/phpstan.neon.dist#L8 line removed (to reproduce, phpstan should finish in about a minute)
ondrejmirtes commentedon Dec 20, 2022
Should be fast now. Please test PHPStan 1.9.5 once it's released :)
mvorisek commentedon Dec 20, 2022
Let's keep this issue open until released. If ok, I will be happy to provide a regression test for it then as this caused a lot of trouble for me in the past. Thank you.
ondrejmirtes commentedon Dec 20, 2022
@mvorisek I couldn't test your linked commit because the branch probably got deleted, or it's in a different fork.
Anyway, this thread got too long, I want people to open new issues with specific examples. I believe many examples from this thread are fixed.
mvorisek commentedon Dec 20, 2022
@ondrejmirtes see tecnickcom/TCPDF@37aa6ee last week merged officially to TCPDF - so how to test? clone https://github.com/tecnickcom/TCPDF.git and remove
fonts/fromexcludePathsin the phpstan configondrejmirtes commentedon Dec 20, 2022
You can now compare 1.9.4 vs 1.9.x-dev and report back.
mvorisek commentedon Dec 21, 2022
I can confirm now TCPDF finish in a few minutes. Thank you.
github-actions commentedon Jan 22, 2023
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.