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: startup is slow even with shared cache #48844

mattdee123 opened this issue Oct 7, 2021 · 2 comments

x/tools/gopls: startup is slow even with shared cache #48844

mattdee123 opened this issue Oct 7, 2021 · 2 comments


Copy link

@mattdee123 mattdee123 commented Oct 7, 2021

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:

  1. Obtain a large codebase. I used this script to generate one for testing with 2047 packages.
  2. Add the following configuration to .vimrc: let g:go_gopls_options = ['-debug=:0', '-remote=unix;/tmp/gopls-daemon-socket', '-logfile=auto', '-rpc.trace']
  3. Start gopls server with gopls -listen="unix;/tmp/gopls-daemon-socket" -logfile=auto -rpc.trace
  4. Open a file in vim, immediately try to jump to declaration. After hanging for over 10 seconds, it is eventually responsive.
  5. Repeat step 4. See the same delay.

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
Additionally, the debug server confirmed that both clients were using the same cache
Screen Shot 2021-10-06 at 2 34 08 PM

Build info v0.7.2 h1:kRKKdvA8GOzra8rhSFDClOR7hV/x8v0J0Vm4C/gWq8s= h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA= h1:C0nyHiBU2m0cR6hDiUORWqQIt3h37wsp1255QBSSXqY= h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= h1:ws8AfbgTX3oIczLPNPCu5166oBg9ST2vNs0rcht+mDE= h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA= h1:59Olnbt67UKpxF1EwVBopJvkSUBmgtb468E4GVWIZ1I=
@gopherbot gopherbot added this to the Unreleased milestone Oct 7, 2021
@hyangah hyangah removed this from the Unreleased milestone Oct 7, 2021
@hyangah hyangah added this to the gopls/on-deck milestone Oct 7, 2021
@stamblerre stamblerre changed the title x/tools/gopls: Startup is slow even with shared cache x/tools/gopls: startup is slow even with shared cache Oct 14, 2021
@stamblerre stamblerre self-assigned this Oct 15, 2021
Copy link

@stamblerre stamblerre commented Oct 15, 2021

The duplication of the workspace folders in the session seems like a bug on our end, so we'll investigate.

@stamblerre stamblerre removed this from the gopls/on-deck milestone Oct 19, 2021
@stamblerre stamblerre added this to the gopls/v0.7.4 milestone Oct 19, 2021
@stamblerre stamblerre removed their assignment Oct 19, 2021
Copy link

@gopherbot gopherbot commented Oct 19, 2021

Change mentions this issue: internal/lsp: don't add multiple views for the same folder

gopherbot pushed a commit to golang/tools that referenced this issue Oct 19, 2021
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
Trust: Rebecca Stambler <>
Run-TryBot: Rebecca Stambler <>
Reviewed-by: Robert Findley <>
gopls-CI: kokoro <>
TryBot-Result: Go Bot <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants