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: startup is slow even with shared cache #48844
Comments
The duplication of the workspace folders in the session seems like a bug on our end, so we'll investigate. |
Change https://golang.org/cl/356933 mentions this issue: |
When we add a view, we should check if we already have a view for the given folder. Updates golang/go#48844 Change-Id: I0de27d420e2b4df3b33b913ae27b108bab6b7d12 Reviewed-on: https://go-review.googlesource.com/c/tools/+/356933 Trust: Rebecca Stambler <rstambler@golang.org> Run-TryBot: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This is likely due to |
A while ago I added the "experimentalCacheKey" option, which allows re-using a lot of type-checked packages. That would probably help here, but it needs investigating. If it helps, I believe we can enable this behavior by default. |
gopls@v0.12.0-pre.1 uses a shared cache to persist derived package information across restarts. As a result, startup time for Kubernetes on my computer was reduced from 25s->7s (or 3s using recent go list optimizations not yet released). I am going to close this as tentatively resolved. Please comment if you try out the prerelease and do not observe an improvement. |
What did you do?
I use vim-go, and I generally open and close many vim windows throughout the course of the day. Working on a large codebase, I have noticed that each time I open a new vim, the
gopls
client takes a while to be responsive. I am using the shared daemon, so I expected each subsequent client to start up quickly.To reproduce:
.vimrc
:let g:go_gopls_options = ['-debug=:0', '-remote=unix;/tmp/gopls-daemon-socket', '-logfile=auto', '-rpc.trace']
gopls
server withgopls -listen="unix;/tmp/gopls-daemon-socket" -logfile=auto -rpc.trace
What did you expect to see?
I expected step 5, and all subsequent vim instances to benefit from the shared cache.
I recognize that my expectations may have been off, but this was something I was hopeful a shared daemon would fix.
What did you see instead?
The second instance was just as slow to start up as the first. Below are the logs generated
client1.log
client2.log
daemon.log
Additionally, the debug server confirmed that both clients were using the same cache
Build info
The text was updated successfully, but these errors were encountered: