-
Notifications
You must be signed in to change notification settings - Fork 767
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
Pylance large project issues #590
Comments
@rkrishnasanka, thanks for the report. Could you please add the tracelogs? https://github.com/microsoft/pylance-release/blob/master/TROUBLESHOOTING.md#filing-an-issue thanks |
It's been over a month since we asked for logs; if you can provide them at the latest version we can reopen this to take a look, but without them there isn't much we can do to pin down the performance issues. |
Sorry about the delay. I had to work on another project for sometime and I couldn't exactly replicate the same error but here are the traces for another example where vscode just started slogging to keep up. |
What is |
Better still if the source is available. |
Here's the project that I was using. Here's the The base-base-base class for this is auto-generated using ANTLR (https://www.antlr.org/) |
Thanks @rkrishnasanka, that's really helpful. After a cursory investigation, I've discovered so far that the type analyzer is struggling with some aspect of the BitVector.py module (which is used in |
Thanks @erictraut ! That's good to know. |
I've found the root cause of the performance issue. The file in question ( This fix will be in the next release of Pylance. |
@erictraut I'm curious, what was the underlying cause? |
When pyright attempts to analyze the type of a node in the parse tree, it sometimes needs to speculatively evaluate other nodes. Once those nodes' types are known definitively, they are cached, but during "speculative evaluation", they are not cached because the resulting type might not be correct. The code in the distBlockListener.py contained some nested function calls that represent some worst-case combinatorics of this speculative execution. Here is a stripped-down example: list(
map(
int,
list(
"".join(
map(lambda x: x, list(map(chr, list(b""))))
)
),
)
) The |
Ah, That makes sense, I was looking at some of the issues linked to this and your comments on |
This issue has been fixed in version 2021.1.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202110-6-january-2021 |
Environment data
Expected behaviour
Pylance was working great at the beginning of my project, syntax highlight, pyright annotations, etc. However, as the project grew in size it's been struggling to keep up. It seems like even with basic type checking enabled, it's completely choking now.
Actual behaviour
Logs
The text was updated successfully, but these errors were encountered: