Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: eagerly compute the workspace symbol index #52694

Open
findleyr opened this issue May 3, 2022 · 1 comment
Open

x/tools/gopls: eagerly compute the workspace symbol index #52694

findleyr opened this issue May 3, 2022 · 1 comment
Labels
gopls/performance Issues related to gopls performance (CPU, memory, etc). gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented May 3, 2022

This is a spin-off of #52602, which we're going to close as just an optiimization.

In the future, we should go one step further and populate the workspace symbol index at load time. There's a straightforward way to do this: while type-checking we always have access to the full AST of each package, before filtering. If we eagerly compute the symbol table at that time, it should be ~free.

However, I don't want to do this yet, because the cost of inheriting all these symbol handles on each generation is still too high, and our heuristic for which symbol handles to keep around is essentially "all of them", not just those that are reachable from workspace packages.

Once we have more control over snapshot data, we can re-consider this eager calculation.

@findleyr findleyr added this to the gopls/on-deck milestone May 3, 2022
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels May 3, 2022
@findleyr findleyr added this to Backlog in Gopls Backlog May 10, 2022
@findleyr findleyr removed this from Backlog in Gopls Backlog May 10, 2022
@hyangah hyangah added the gopls/performance Issues related to gopls performance (CPU, memory, etc). label May 10, 2022
@findleyr
Copy link
Contributor Author

I think it might suffice to store pre-computed symbol information on disk, and load from disk rather than parsing and re-building symbol information from scratch. If that takes the initial symbol time for Kubernetes down below ~1 second, no need to pre-build symbol data.

@adonovan: this may be a good proof-of-concept for on-disk indexing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls/performance Issues related to gopls performance (CPU, memory, etc). gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants