Skip to content
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

Remember stub files and their errors in result cache #5826

Closed
dktapps opened this issue Oct 23, 2021 · 5 comments
Closed

Remember stub files and their errors in result cache #5826

dktapps opened this issue Oct 23, 2021 · 5 comments

Comments

@dktapps
Copy link
Contributor

dktapps commented Oct 23, 2021

Feature request

While debugging #5825 , I'm discovering a range of interesting problems, mostly due to Windows' slow I/O.

I found it interesting that StubValidator doesn't use the result cache at all, because validating stubs takes nearly 25% of the pre-analysis step time (under xdebug that's about 1 second out of 4; at normal runtime it would be closer to 300ms).

This might seem insignificant, but I find it odd that stubs aren't remembered by the result cache like normal files.

I'm looking to save all the pre-analyse time I can find here, because this pre-analyse lag is a pretty huge annoyance for using PHPStan on Windows (particularly when integrated with PHPStorm, because it takes quite some time to respond - 300ms is a pretty significant amount of time in that case).

@dktapps
Copy link
Contributor Author

dktapps commented Oct 23, 2021

Some more context on this: about 15% of the time is actually spent to generate the Nette DI container for config.stubValidator.neon. Only 10% is actually analysing the files themselves (though still unnecessarily). Go figure.

@staabm
Copy link
Contributor

staabm commented Oct 24, 2021

Maybe its related nette/di#269

@dktapps
Copy link
Contributor Author

dktapps commented Oct 24, 2021

Not sure. But one way or another, this extra 25% time can be avoided quite easily.

@ondrejmirtes
Copy link
Member

Done: phpstan/phpstan-src@d96e8f0

@github-actions
Copy link

github-actions bot commented Mar 4, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants