-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
VScode freezes when displaying long symbol lists in "Go to symbol search" #36941
Comments
//cc @bpasero this could be our picker code as well. |
@SirIntruder Can you share that workspace with us or can you create a performance profile when doing this? This guide shows you how to do it: https://github.com/Microsoft/vscode/wiki/Performance-Issues#profile-a-vs-code-window |
I can reproduce with the snippet below... Lot's of time is spend in IPC'ing and tracking the data: vscode.languages.registerWorkspaceSymbolProvider({
provideWorkspaceSymbols() {
let n = 30000;
let words = ['Foo', 'Provider', 'Abstract', 'Deletgate', 'Impl', 'Bar', 'Baz', 'Registry', 'TextSource', 'Factory'];
let result = new Array<vscode.SymbolInformation>();
while (n-- >= 0) {
let name = words[Math.floor(Math.random() * words.length)] + words[Math.floor(Math.random() * words.length)];
result.push(new vscode.SymbolInformation(name, vscode.SymbolKind.Struct, 'someParent', new vscode.Location(vscode.Uri.parse('some:file/' + n), new vscode.Position(0, 0))));
}
return result;
}
}) |
I am closing this as a dupe of the issues mentioned above |
Steps to Reproduce:
Result:
Up to some amount of symbols, find symbols was reasonably responsive. Than it starts to drop as you add more symbols, While symbol list is being processed, VSCode CPU usage spikes, and VSCode is completely unresponsive for X amount of seconds, where X appears to grow exponentially with amount of symbols.
At 50.000 symbols I got a "page is unresponsive" dialog after waiting for a minute or so.
Also, dismissing resulting symbol list in the ui is very slow as well.
Is this omnisharp-vscode fault?
This was my suspicion, but after tinkering a bit I think it is a vscode issue.
Since I am developing in c#, omnisharp-vscode is implementation of WorkspaceSymbolProvider I use. This is their implementation.
I added some logs there and it appears that both symbol providing by omnisharp language server, and mapping of symbol objects are done almost instantly. VSCode becomes unresponsive while processing the returned list.
Fact that dismission of symbol list lasted for 4 seconds makes me think this has something to do with having huge amount of items in the dropdown
Conclusion
Minimum I would expect is to not have VScode frozen/unresponsive when displaying huge amount of symbols. Currently you are stuck with waiting for vscode to display ALL symbols before you even get a chance to narrow down search terms. And you have to wait AGAIN if you clear search terms to type another.
I fixed problem for myself by not returning anything when search string is empty, thus avoiding to wait for 32200 symbols I have in my main project, but I believe there should be better support for this problem on vscode side.
The text was updated successfully, but these errors were encountered: