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: gopls is laggy and slow #40092

Closed
krijohs opened this issue Jul 7, 2020 · 2 comments
Closed

x/tools/gopls: gopls is laggy and slow #40092

krijohs opened this issue Jul 7, 2020 · 2 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

@krijohs
Copy link

krijohs commented Jul 7, 2020

What version of Go are you using (go version)?

go version go1.14.4 linux/amd64

gopls

golang.org/x/tools/gopls 0.4.2
    golang.org/x/tools/gopls@v0.4.2 h1:SPpw/YOMhYKB5TjtZj77ddcTDQkpkUZtw4+0jtVYwro=

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
GO111MODULE="auto"
GOARCH="amd64"
GOBIN="/home/kristoffer/dev/go/bin"
GOCACHE="/home/kristoffer/.cache/go-build"
GOENV="/home/kristoffer/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/kristoffer/dev/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build130302756=/tmp/go-build -gno-record-gcc-switches"

Output of

2020/07/07 14:03:01 Info:2020/07/07 14:03:01 Build info
----------
golang.org/x/tools/gopls 0.4.2
    golang.org/x/tools/gopls@v0.4.2 h1:SPpw/YOMhYKB5TjtZj77ddcTDQkpkUZtw4+0jtVYwro=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
    golang.org/x/sync@v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
    golang.org/x/tools@v0.0.0-20200701133321-6ddc6be4d35f h1:0YooLLGGxVRx2qHHVzitbm1g2pS6ar7dW2nO8aEiOdA=
    golang.org/x/xerrors@v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
    honnef.co/go/tools@v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

Go info
-------
go version go1.14.4 linux/amd64


2020/07/07 14:03:01 Info:2020/07/07 14:03:01 go env for /home/kristoffer/dev/4uji/backend
(valid build configuration = true)
(build flags: [])
GO111MODULE="auto"
GOARCH="amd64"
GOBIN="/home/kristoffer/dev/go/bin"
GOCACHE="/home/kristoffer/.cache/go-build"
GOENV="/home/kristoffer/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/kristoffer/dev/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/kristoffer/dev/4uji/backend/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build478323602=/tmp/go-build -gno-record-gcc-switches"

2020/07/07 14:03:01 Info:2020/07/07 14:03:01 go/packages.Load
        snapshot=0
        directory=/home/kristoffer/dev/4uji/backend
        query=[./... builtin]
        packages=29
2020/07/07 14:03:02 anonymous structs are not yet supported: ()
2020/07/07 14:03:02 anonymous structs are not yet supported: ()
2020/07/07 14:03:02 anonymous structs are not yet supported: ()
2020/07/07 14:03:02 anonymous structs are not yet supported: ()
2020/07/07 14:03:02 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:03 anonymous structs are not yet supported: ()
2020/07/07 14:03:04 anonymous structs are not yet supported: ()
2020/07/07 14:03:04 anonymous structs are not yet supported: ()
2020/07/07 14:03:04 anonymous structs are not yet supported: ()
2020/07/07 14:03:04 anonymous structs are not yet supported: ()
2020/07/07 14:03:04 anonymous structs are not yet supported: ()
2020/07/07 14:03:04 anonymous structs are not yet supported: ()
2020/07/07 14:03:04 anonymous structs are not yet supported: ()
2020/07/07 14:03:04 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:05 anonymous structs are not yet supported: ()
2020/07/07 14:03:06 anonymous structs are not yet supported: ()
2020/07/07 14:03:06 anonymous structs are not yet supported: ()
2020/07/07 14:03:06 anonymous structs are not yet supported: ()

What did you do?

Using Vscode and working with a project that has around 18000 lines of code. Some packages have around 8k lines.
Editing the go files and saving them.

What did you expect to see?

The file getting saved, autocompletion and linting working.

What did you see instead?

Whenever I save or edit the file the editor gets laggy and saving hangs for a while, sometimes up a minute with the message ''Getting code actions" , during that time autocompletion and linting does not work. Sometimes it helps to edit the file again and save again.

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Jul 7, 2020
@gopherbot
Copy link

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jul 7, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jul 7, 2020
@krijohs krijohs changed the title x/tools/gopls: Gopls is laggy and slow on saving files x/tools/gopls: Gopls is laggy and slow Jul 7, 2020
@stamblerre stamblerre changed the title x/tools/gopls: Gopls is laggy and slow x/tools/gopls: gopls is laggy and slow Jul 7, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 Jul 7, 2020
@krijohs
Copy link
Author

krijohs commented Jul 7, 2020

I just saw that an issue has been created in the vscode-go repository which has more information about the problem. So closing this in favor of it. golang/vscode-go#299

@krijohs krijohs closed this as completed Jul 7, 2020
@stamblerre stamblerre modified the milestones: gopls/v0.5.0, gopls/v0.4.4 Jul 9, 2020
@golang golang locked and limited conversation to collaborators Jul 9, 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