-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
GoDoc 8 second lag #3546
Comments
Thank you for the thorough report. Let's see if you can get things sorted out.
🤔 that's not terribly surprising:
Are these largish repositories? Does the delay occur on subsequent attempts, or is it only the first attempt? Does it matter if
The code you linked shows that it didn't call
The old code also went through |
E.g. this package itself is not large, but it imports larger libraries (a.k.a. vendors). This happens on all subsequent calls. I have confirmed that gopls is initialized.
Interesting. I guess misunderstood the arg. However, I can confirm that that this is the commit where GoDoc begins to lag on the |
Thank you for looking into this! The size of the repository does affect the delay. For example, it is not perceivable on https://github.com/golang/example. I would be curious to see if you can reproduce this using the PDCSI directly, e.g. under https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/blob/master/pkg/gce-pd-csi-driver/controller.go. I think it's notable that the following action fixes the behavior and eliminates the lag. Although I have to say I'm not sure what it's doing in the larger context other than eliminating that 8 second delay caused by
Also, if I interrupt the |
I do see a delay, but not nearly as significant as you've reported.
That works right up until it doesn't. The call to But I do see a way to optimize this. I'll put up a PR soon. |
I get a similar behavior in my usage. Although I'm using Neovim which I know isn't supported
there were a few other related bits, i'll attached the full log below no issue if I try this:
|
I've been looking at this and want to correct a misstatement I made previously. The call to I'm still trying to figure out a way to improve the performance here. It's not as simple as I thought it might be, but I think I'm going to be able to improve this. |
Get the package name of the identifier under the cursor using the doc link provided by lsp. This fixes two problems: performance of trying to rely on go list via go#tool#Imports() to get the package name and that the package name is sometimes being set incorrectly to a method receiver. Fixes fatih#3546
Get the package name of the identifier under the cursor using the doc link provided by lsp. This fixes two problems: performance of trying to rely on go list via go#tool#Imports() to get the package name and that the package name is sometimes being set incorrectly to a method receiver. Fixes fatih#3546
Get the package name of the identifier under the cursor using the doc link provided by lsp. Fixes fatih#3546
Get the package name of the identifier under the cursor using the doc link provided by lsp to improve performance vs trying to rely on go list via go#tool#Imports() to get the package name. Fixes fatih#3546
What did you do? (required: The issue will be closed when not provided)
:GoDoc<CR>
with the cursor over a functionWhat did you expect to happen?
Instantly show me the godoc for the function or field.
What happened instead?
8 seconds of lag every time the command is issued.
I have two fixes:
I believe the reason for this is that the old code called
go doc
directly:Whereas the new code has to go through the goimports flow.
Notes:
:GoImports<CR>
experiences no lag and returns immediately.Configuration (MUST fill this out):
vim-go version:
Latest (1.28)
vimrc
you used to reproduce:Vim version (first three lines from
:version
):Go version (
go version
):gopls version
The text was updated successfully, but these errors were encountered: