-
Notifications
You must be signed in to change notification settings - Fork 769
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
"Go to Symbol in Workspace" (⌘T) becomes very slow in seemingly inconsistent ways due to indexing #997
Comments
Thanks for the report. We will investigate this performance issue. Could you please provide the logs? Or at least the top of the logs. I'm concerned the devcontainer is opening at the top of the root of the container. |
I just reloaded the window and this is the top of the logs:
This is what I get when grepping the initial logs for
And this is the result of grepping for
As already mentioned before, the last line of the initial logs is this:
And when I then hit ⌘T and tried to search for a class, it was still slow and I started getting a whole bunch of logs starting with I guess this was already quite obvious from the above, but so this is in a multi-root workspace where
Hope this helps? Do let me know if you need any further info! |
That does help; I was just trying to figure out if your project really contained 2000+ files or if we had the workspace root wrong. If you look at the trace logs, do you see any files that really shouldn't be analyzed within that |
No, that number of source files seems to be correct actually. It's just a large codebase I'm afraid. For what it's worth: I wouldn't mind if the initial indexing takes a while, as long as it only needs to happen once. Afterwards I'd expect it to only be necessary for new or changed files? It'd be good to have something in the status bar or so to make it clear that indexing is going on then though. As far as I know that's basically what PyCharm does, and they do manage to cope with our large codebase in that way. |
Most settings changes can significantly change the analysis; any change or file change event in the search paths can change something and our current method is to just about everything away without much granularity. This works fine for most features (as they are lazy and evaluate on the fly), but indexing is of course ahead-of-time. The 2000 limit is hardcoded, but we could potentially experiment with some configuration there. A spinner for an in-progress indexing job may also be a good idea. |
Making the file limit configurable and showing a spinner when indexing is in progress could already be a big step forward I think! I'd definitely be happy to experiment with that and report back on how much it improves things for us. I also found out today that excluding subpackages in |
@klbostee can you check whether this still repo with latest release? one of reason this might have happened before was due to multi root workspace causing re-indexing. we have made a few changes around there so wondering whether it is still reproes. thank you |
@heejaechang haven't tested extensively yet, but it does seem to be better now at first sight! |
Closing old issue. If this is still a problem, please reopen the issue. thanks |
Environment data
Expected behaviour
With
python.analysis.indexing
set totrue
, I would expect "Go to Symbol in Workspace" (⌘T) to always be fast and not become unusably slow intermittently.Additionally, I'd also expect to see some sort of visual indication for when indexing is taking place so that I can know that lookup performance might temporarily be affected.
Actual behaviour
Initially (e.g. after a window reload) ⌘T is very slow while the indexing is being performed (which is something I was only able to figure out after setting
python.analysis.logLevel
toTrace
and looking at the Python Language Server output) and after that it gets slow again intermittently whenever Pylance decides to do some more indexing. It's not entirely clear to me what exactly triggers the additional indexing, but initiating a "Go to Symbol in Workspace" (⌘T) also seems to trigger it sometimes (which is kind of unfortunate, because that then makes the ⌘T very slow).Logs
The initial indexing (e.g. after window reload) eventually stops with this message in the logs:
And then whenever ⌘T gets slow again it's pretty obvious from the logs that more indexing is being done.
Additional information
At first I thought the slowness might've been related to the fact that I was working in a dev container, but it turns out I'm getting the same issues when developing directly on macOS. The dev container does add a noticeable delay to ⌘T that makes it a bit less instant, but that's a very short and consistent delay that doesn't impede fluent navigation. The intermittent (extreme) slowness due to indexing happens for both setups.
I've already tried setting
python.analysis.indexing
tofalse
by the way, but that basically makes ⌘T too slow pretty much all of the time. In fact, I was very excited when I found out about the possibility of enabling indexing because that actually gets us quite a bit closer to having usable symbol-based code navigation in VS Code. It's definitely looking very promising, as does Pylance in general!The text was updated successfully, but these errors were encountered: