Skip to content

x/tools/gopls: optimize calculation of the workspace symbol index #52602

@findleyr

Description

@findleyr

Right now, the workspace symbol index is populated on the first workspace symbol request, theoretically to optimize for clients that don't use workspace symbols at all.

I recalled this taking ~5s for a large repo like Kubernetes, after which subsequent workspace symbol requests take <100ms. Seemed OK. However, testing this now it often takes 20s+ for the initial population with Kubernetes (and is surprisingly variable). We should either improve this initial performance, or eagerly populate the symbol table.

The symbol handle (which generates symbols for a file) currently bypasses the cache for the parsed file, i.e. re-parses the file, to avoid pinning the parsed file in the cache. We can probably speed up the initial symbol load significantly by supporting cache-peeking, so that we can leverage existing parsed files in memory, if they exist, without pinning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions