Unnecessary re-indexing on start-up and project opening
Hello!
I am just wondering what is the reason for re-indexing of a whole project each time I launch the IDE or open a project even in case there have been no changes to any of the files since previous re-index? It takes very long (5-10 minutes) and consumes 100% of all CPU cores.
Please sign in to leave a comment.
As a starting point, could you please confirm if you have any custom plugins installed & enabled?
Yes, I have the following:
https://plugins.jetbrains.com/plugin/9388-yii2-support/
https://plugins.jetbrains.com/plugin/9746-ideolog/
https://plugins.jetbrains.com/plugin/4230-bashsupport/
Just disabled all of them (as well as some of the bundled). Restarted the IDE, and encountered the same behavior - long and painful re-indexing.
Please tell more about your project, are there any files that can be changed externally or with some 3rd party tools?
What OS do you have, is there any chance that the project is located on a network share? Also, I was wondering if you have ever tried running "Invalidate caches" operation.
Well, this happens disregarding of the types of projects. Most of them are Yii2 applications with the respective vendor directory contents. But the same problem happens to Vue projects and even plain html projects (which get indexed much faster but still are re-indexed at each and every project opening or IDE restart).
I have Xubuntu 18.04, PhpStorm is currently 2019.3, but previous versions behave the same way. All files are on local disk and don't get changed with anything external. I've never invalidated any caches. But even if I would, I assume that re-indexing should be done just once after dropping of the cache.
Could you tell me more details of how phpstorm decides to start re-indexing?
UPD. Just looked into idea.log and found many entries like this:
So the main question is what the IDE considers to be "refreshed files"?
Same on my machine. Using Windows 10.2004 latest PHPStorm. I have plenty plugins installed. This is especially nagging on very large projects. But, PHPStorm takes also long time to index scratch files.
Please take note that you may mark some folders as "Excluded" to keep these away from indexing.
It could be extremely useful for any non-code specific files that tend to be changed often like caches or logs.