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

Performance problem - Rescanning all services during stub registration. #146

Open
bendavies opened this issue Feb 15, 2021 · 2 comments
Open

Comments

@bendavies
Copy link
Contributor

Hi there,

This plugin is causing a large performance penalty which is most obvious on symfony projects with a large amount of services.

This line:

$codebase->queueClassLikeForScanning($className);

is causing all services to be re-scanned, and is being triggered here: https://github.com/vimeo/psalm/blob/a80d5b736bddfee3e1d261ad3460d9fa8e7879f0/src/Psalm/Config.php#L1811

In my particular use case that's waiting 1 minute plus for thousands of services to be re-scanned - for a simple change to one file.

I have discussed this with @muglug on slack briefly, and the suggestion is that Codebase::queueClassLikeForScanning needs a way to specify that the file to be scanned is not a stub.

Raising here for before that conversation disappears into the ether.

Thanks

@bendavies
Copy link
Contributor Author

bendavies commented Feb 24, 2021

Today I've tracked down that this is actually causing a bug, and not just a performance problem.
This is causing all service classes to be marked as not user_defined: https://github.com/vimeo/psalm/blob/e59670ef6856fcabce2629d2fccebaabfb1f4b5c/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php#L229

which triggers extra incorrect errors to surface such as MethodSignatureMismatch, that should never occur.

@bendavies
Copy link
Contributor Author

@muglug @seferov i'm looking to take a look at fixing this. can you provide some guidance? I'm a bit lost on the flow of everything to be honest :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant