Replies: 1 comment 6 replies
-
|
Yeah, if you have that many files it will take some time. If you directly analyse these files, or you've configured scanDirectories to look through them, or if you configured composer autoloading with classmap for those directories, it will go through OptimizedDirectorySourceLocator. Some caching could be done but typically this doesn't take too much time even on very large projects (12k files) so I haven't looked into it much. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As I sit here running phpstan over and over to fix some issues. And kvetch to myself that every run in this one setup was taking 46seconds. I got to thinking: "Huh, even when nothing is changed, it seems to take that long. Shouldn't the resultCache/caching in general handle that?
So while doing other things I poked around a bit at the code, and ran xdebug profiling on it just cause I wanted to understand where all that time was going.
And if I understand what I saw correctly (I may not have):
$this->classToFile&&$this->functionToFilesIf my quick poke/profile/playing around is correct, looks like this happens every time phpstan runs, regardless of the state of the cache. And these lookup tables themselves aren't cached.
If I'm right, is there a reason? Just curious, because in my case with a repo that (for reasons) may have like 50-80k PHP files that it needs to scan for symbols/functions ... and yeah, that's taking like 35s it looks like every time. If the output of those would be cached instead, that would dramatically speed stuff up (in my case)
But again, I may be misunderstanding exactly what's going on there. Just interesting and poking around
Beta Was this translation helpful? Give feedback.
All reactions