phpstan-src icon indicating copy to clipboard operation
phpstan-src copied to clipboard

`OptimizedDirectorySourceLocator` based only on `PhpParser`

Open kukulich opened this issue 3 years ago • 5 comments

kukulich avatar May 05 '22 13:05 kukulich

@kukulich just found this PR. Is it still relevant? Is there a concrete problem beeing solved here (it looks like its a performance improvement)?

staabm avatar Dec 03 '22 08:12 staabm

I discussed it with @ondrejmirtes directly. I think we tried to get rid of the reqexp in OptimizedDirectorySourceLocator.php::findSymbols() because it has some problems. However I think there were some problems with the failing tests and it was not caused by this PR. I will try to rebase this PR to refresh the checks.

kukulich avatar Dec 03 '22 08:12 kukulich

This PR makes future maintenance of this locator easier but right now has worse performance.

I have a plan to address this - we could make PHPStan faster because right now, the same work is done by all child processes which means it's done 8 times during each run. Instead, we could populate some cache in the main process before launching child processes, and those child processes could just read the cached data instead of doing all the work again.

ondrejmirtes avatar Dec 04 '22 08:12 ondrejmirtes

Rebased.

kukulich avatar Dec 05 '22 09:12 kukulich

This pull request has been marked as ready for review.

phpstan-bot avatar Dec 05 '22 09:12 phpstan-bot