Skip to content

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

Closed

Description

@noam-zur

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

Activity

  1. sean-mcmanus commented on Aug 4, 2021

    @sean-mcmanus
    Contributor

    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?

  2. noam-zur commented on Aug 4, 2021

    @noam-zur
    Author

    Hi Sean McManus (@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.

  3. changed the title [-]"Go To Symbol in Workspace..." is very slow on large projects[/-] [+]"Go To Symbol in Workspace..." has very slow "init-time" on large projects[/+] on Aug 4, 2021
  4. noam-zur commented on Aug 6, 2021

    @noam-zur
    Author

    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 (@sean-mcmanus), can you please comment on this?
    Any pointers where to look into next will be appreciated

  5. sean-mcmanus commented on Aug 7, 2021

    @sean-mcmanus
    Contributor

    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.

  6. sean-mcmanus commented on Aug 7, 2021

    @sean-mcmanus
    Contributor

    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.

  7. noam-zur commented on Aug 8, 2021

    @noam-zur
    Author

    Thank you Sean McManus (@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!

  8. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Aug 25, 2021
  9. fearthecowboy commented on Feb 13, 2024

    @fearthecowboy
    Contributor

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

  10. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Feb 13, 2024
  11. locked and limited conversation to collaborators on Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions