vscode-cpptools
vscode-cpptools copied to clipboard
"Go To Symbol in Workspace..." has very slow "init-time" on large projects
Bug type: Language Service
- OS and Version: Windows10 (Version 2004)
- VS Code Version: 1.58.2
- C/C++ Extension Version: v1.5.1
"Go To Symbol in Workspace..."(CTRL+T) is very slow on large projects.
As a benchmark, I opened a workspace on Linux code base, and searched for "memory". Results for the first search are abnormally long (~25 seconds)
Notes:
- I set C_Cpp.intelliSenseEngine to "Tag Parser" (my preferred choice)
- The workspace was fully parsed before running the search.
- For comparison, on Source Insight IDE, results for the same symbol search are instant (<1s).
Expected behavior Full Workspace Symbols Search should return results faster
I'm seeing the 1st Go to Symbol be slow but then it speeds up, but still takes a few seconds. Is that what you're seeing or do you see 25 seconds repeatedly?
Hi @sean-mcmanus , your observation is correct - it takes 25-30s on first search (after each time the editor is started). Afterwards, it takes ~3s per search, which is still problemtic when trying to browse large code bases. Let us have this issue(#7908) deal with the 25s "init-time". I opened new issue(#7914) to deal with the "snappiness" of additional of searches.
I have started to debug the issue and traced the time-consuming call to:
workspaceSymbolProvider.ts line 20:
const symbols: LocalizeSymbolInformation[] = await this.client.languageClient.sendRequest(GetSymbolInfoRequest, params);
Now I am trying to understand if I can I debug it any further or the request is being handled by a closed-source client process. @sean-mcmanus, can you please comment on this? Any pointers where to look into next will be appreciated
It's in our closed source cpptools server binary. The slow Go to Symbol in Workspace issue issue has been known for 5 years or so...the code hasn't changed much in 5 years, i.e. we've been working on other systems, and improving the performance of Go to Symbol in Workspace hasn't gotten high enough priority. As I recall, it's not an easy fix, and involves code shared with VS.
You could try to run a profiler on cpptools to get more performance data: https://github.com/microsoft/vscode-cpptools/wiki/Troubleshooting-Performance-Issues ...but it's unlikely the results of that would lead us to be able to quickly fix it.
Thank you @sean-mcmanus for your clear response. While a bit dissapointing, it is still good to know that no fix is expected soon. I will try to search for alternatives on my end. Thanks!
A significant update to Go To Symbol has been published in the insiders build - see #11557