x/tools/gopls: optimize calculation of the workspace symbol index #52602
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
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.
The text was updated successfully, but these errors were encountered: