This prerelease version of gopls contains a major rewrite of the way gopls computes and stores package information, with the goal of reducing memory usage and allowing gopls to scale to larger repositories. This change can also significantly reduce startup time the second time a workspace is opened, as gopls now uses a file-based cache to preserve derived package information across sessions. With these optimizations, gopls is finally able to fully analyze dependencies using the x/tools/go/analysis
framework, resulting in improved accuracy for analysis diagnostics.
We'd love help testing this large change! If you are interested, please see below for details on what to expect, and how to report problems.
What to expect
In general, gopls@v0.12.0-pre.1 should behave similarly to gopls@v0.11.0, but use much less memory. Memory savings typically range from 50-90%, depending on the shape of your repository. Note that memory will peak higher during startup or large operations, but should ideally never go as high as with gopls@v0.11.0, and in-use memory should stabilize at a much lower number. To see details about current memory usage, start gopls with -debug=localhost:8080
and visit http://localhost:8080/memory.
As part of the rewrite, certain operations may have gotten slightly slower overall, whereas others may have gotten slightly faster (e.g. see our performance dashboard). No operation should become unusably slow.
However, it is possible that gopls' new execution model performs disproportionately worse on certain operating systems, file systems, or repositories. If you encounter this, please let us know. See below for details on how to report a problem.
Support changes
This version of gopls implements the support changes discussed in the v0.10.0 release notes. Notably, it does not support Go 1.13-1.15, and removes support for several experimental features.
How to report a problem
You can always report a gopls problem by filing an issue. We are particularly interested in any regressions you observe since gopls@v0.11.0.
If you would prefer not to report an issue on the issue tracker, you can also reach out to us via email to rfindley@google.com or adonovan@google.com.
We are aware of a number of remaining issues or regressions with the new release, tracked in the v0.12.0 milestone.
What's next?
We will continue to polish this release, and fix known regressions. We may make additional small performance improvements but do not expect large changes. Nevertheless, since this release constitutes a fundamental change to the way gopls works, we will likely cut one or more additional prereleases before the final release.
Looking beyond the v0.12.0 release, the recent redesign work paves the way for our next effort to make gopls self-configuring in more scenarios. With the previous design this would have been prohibitively expensive in memory, but soon gopls should just Do The Right Thing when you open any Go file on your machine.