vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

"Go To Symbol in Workspace..." has very slow "init-time" on large projects

Open noam-zur opened this issue 3 years ago • 7 comments

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:

  1. I set C_Cpp.intelliSenseEngine to "Tag Parser" (my preferred choice)
  2. The workspace was fully parsed before running the search.
  3. 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

noam-zur avatar Aug 03 '21 09:08 noam-zur

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?

sean-mcmanus avatar Aug 04 '21 01:08 sean-mcmanus

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.

noam-zur avatar Aug 04 '21 06:08 noam-zur

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

noam-zur avatar Aug 06 '21 07:08 noam-zur

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.

sean-mcmanus avatar Aug 07 '21 01:08 sean-mcmanus

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.

sean-mcmanus avatar Aug 07 '21 01:08 sean-mcmanus

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!

noam-zur avatar Aug 08 '21 15:08 noam-zur

A significant update to Go To Symbol has been published in the insiders build - see #11557

fearthecowboy avatar Feb 13 '24 21:02 fearthecowboy