Open asparagusbeef opened 1 month ago
Can you provide us with access to your code so we can attempt to reproduce this behavior?
I am sorry, I cannot. This is a very large private code base. It does not happen in isolation, only when everything interacts.
I am sorry, I cannot. This is a very large private code base. It does not happen in isolation, only when everything interacts.
In that case, can you please collect a CPU profile of the issue? The profile may contain enough information for us to track down the underlying issue. There are instructions on how to do this here: https://github.com/microsoft/pylance-release/wiki/Collecting-data-for-an-investigation.#collecting-cpuprofiles
Sure. I reproduced using the same process:
dispatcher.py
in the company-commons
workspace, and wait for the logs to stop and analysis to complete.Note that I waited long minutes at idle parts (I made the change, left the computer for a while, not sure how long, then stopped profilling).
Thanks!
@asparagusbeef, thanks for the CPU profiles. Unfortunately I'm unable to load the ones that are most interesting, and my best guess is that I'm hitting a VS Code bug there. I filed https://github.com/microsoft/vscode/issues/223565. I'm blocked on analyzing your files until I hear back from the VS Code team on this.
Note that I waited long minutes at idle parts (I made the change, left the computer for a while, not sure how long, then stopped profilling).
@asparagusbeef, since the size of these files seems to be causing problems for profile viewers, could you try generating a new set of profiles and minimizing the duration of the recording?
@asparagusbeef I have another idea to figure out the perf cause. since the log shows some files takes long time to analyze, how about you provide us this log (https://github.com/microsoft/pylance-release/wiki/Collecting-data-for-an-investigation.#collecting-type-evaluation-related-data-in-the-log)
if you can do this and provide log for us, that will provide us best chance to find out what is causing perf issue.
...
python.analysis.diagnosticMode
to OpenFileOnly
, set python.analysis.typeCheckingMode
to off
and set python.analysis.indexing
to false
, and python.analysis.enablePytestSupport
to false
python language server
output windowpython language server
output window, and provide them with us....
my gut feeling is some of your code require a lot of time for us to infer types. so if you provide type hints at some strategic points, that might improve overall perf.
Environment data
Code Snippet
Cannot provide a code snippet as this happens in a large project with multiple workspaces.
Repro Steps
My project consists of 11 services that use 6 private packages (installed with
pip install --editable
) This happens in two scenarios:company-commons
package.Note that scenario 2 doesn't happen when a package is installed with regular
pip install
.Expected behavior
I understand this is a large project, but I'm pretty sure my computer should be able to handle it at least an acceptable latency.
Actual behavior
It's excruciatingly slow. Sometimes over 2+ minutes for a small change.
Logs
My process for those logs was:
dispatcher.py
in thecompany-commons
workspace, and wait for the logs to stop and analysis to complete.https://pastebin.com/gRp7x9bd