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: cache results of packages.Load #35968

Closed
stamblerre opened this issue Dec 4, 2019 · 3 comments
Closed

x/tools/gopls: cache results of packages.Load #35968

stamblerre opened this issue Dec 4, 2019 · 3 comments
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

Comments

@stamblerre
Copy link
Contributor

@heschik has noticed that we often start running the same go/packages.Load call 3 times in parallel on VS Code starting up. This is likely because VS Code issues 3 requests, and rather than wait on the results of packages.Load for the second 2 requests, we just see that they are not yet cached and start loading. We should use the internal/memoize package for metadata requests so that the subsequent two requests can block, rather than perform redundant reloads.

@stamblerre stamblerre added this to the gopls v1.0 milestone Dec 4, 2019
@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 Dec 4, 2019
@heschi
Copy link
Contributor

heschi commented Jan 22, 2020

I think this is obsoleted by the new whole-workspace load strategy.

@stamblerre
Copy link
Contributor Author

Yes, agreed.

@stamblerre
Copy link
Contributor Author

Re-opening, as this is actually necessary for #34111. The main obstacle here is determining a cache key for the calls to packages.Load, since they depend on the entire file system state.

/cc @findleyr

@stamblerre stamblerre modified the milestones: gopls/v1.0.0, gopls/v0.4.0 Jul 22, 2020
@golang golang locked and limited conversation to collaborators Jul 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.
Projects
None yet
Development

No branches or pull requests

3 participants