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
StubValidator::validate() accounts for ~30% of phpstan execution time for a single file #6693
Comments
There are some things that make it faster:
|
Awesome! I confirm that this speeds things up :)
I'm using this in CI, but I've found that it's not suitable for commit hooks and IDEs because it can take too long: a few minutes when the cache is invalidated or at least 7-8s on some project when cached. So I was searching for a way to execute phpstan quickly when I save a file in my editor. To give you an idea, analyzing the whole project when fully cached takes 7-8s, from which:
|
Would phpstan/phpstan-src#744 help you regarding these 35% ? |
Oh, I just got an idea - ignored errors regexes could be validated as part of a DIC compiler extension and thus only once when they are changed, not each time when PHPStan is executed :) |
I've almost got it :) But I noticed that the errors from the baseline are not current validated thanks to this line: https://github.com/phpstan/phpstan-src/blob/2d52a5b077b504898fbc78874476b22d18d605d8/src/Analyser/IgnoredErrorHelper.php#L79-L81 So a big baseline doesn't matter here. |
Here it is: phpstan/phpstan-src@692158c Please wait a bit so that it builds and then test phpstan/phpstan:dev-master :) Thanks. |
I didn't expect that. It's weird that it was taking so much time then.
Awesome! I confirm that this completely eliminates the |
Alright, can I close this or do you see any other bottleneck that can be solved? 😊 |
Yes, I'm closing the issue now. Thank you :) |
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. |
Feature request
StubValidator::validate()
accounts for ~30% of the execution time for a command likephpstan analyze -l 9 file.php
.(I'm using phpstan-symfony and phpstan-doctrine, which have some number of stubs.)
Reducing these 30% would enhance the experience of the phpstan integration in phpstorm or vim, for example.
The text was updated successfully, but these errors were encountered: