#gopls performance issues over the last year

12 messages · Page 1 of 1 (latest)

cloud lynx
#

Hey all!

I've been having issues with vscode+gopls for a long time now and I'm pretty done with it so I'm finally going try to investigate what's happening (or just quit using it)

gopls in vscode is driving me insane, I have to restart it every 10 minutes roughly, it freezes almost as soon as I make any sort of syntax error (which is natural when mid-way through writing code)

I have a pair of quite powerful machines (Ryzen 9 5950x, Macbook M3 Pro) and it feels like I'm back on the 2006 family PC... the codebases I work on aren't really huge, a couple of years old and a handful of developers but nowhere near large organisation scale (yet)

Does anyone out there know how to make gopls perform like other language servers? or is it just a matter of spending money on jetbrains?

Or can I disable gopls and switch back to what vscode used before it existed? Or is there an alternative like how the Rust community spawned rust-analyser?

elfin oxide
#

are you able to get any debug logging from it when it freezes (view -> outputs -> gopls)?

#

your experience certainly doesn’t sound universal to me, it sounds like it might be choking on something specific

#

(it also sounds like something that the gopls team might be interested in helping investigate if you’re able to provide them enough information)

cloud lynx
#

Sure I can help! Anecdotally too, a lot of folks in my own discord community experience the same slowness so it seems to be at least somewhat universal at least in my small circle of Go devs

#

it is only on larger projects, one-file libraries are fine, but my day to day is usually on projects of thousands of source files

cloud lynx
#

[Error - 6:28:53 PM] 2024/05/30 18:28:53 imports fixes: AllImportsFixes: D:\Work\projectname\backend\resources\assessment\timeseries.go:147:113: missing ',' before newline in argument list (and 23 more errors)
    file="D:\\Work\\projectname\\backend\\resources\\assessment\\timeseries.go"

[Info  - 6:29:13 PM] 2024/05/30 18:29:13 background imports cache refresh starting

[Info  - 6:29:14 PM] 2024/05/30 18:29:14 background refresh finished after 346.0617ms

Last log before the freeze of death

#

just stuck with this until I either wait probably 10+ minutes or restart it manually

#

And the editor is basically stuck with the errors caused by syntax being wrong due to me writing the code - obviously the syntax will be wrong until I've finished writing, this always seems to trip up gopls

if I edit the code in notepad for example and paste it in and it's syntactically correct, gopls is fine, it's just while I'm editing and producing obvious mid-edit invalid syntax at some point it just chokes and gives up

#

if vscode had an "end of year summary" this command would be in the thousands for sure 😂 😭

cloud lynx
#

Reviving a dead thread but this is continuing to piss me off

Could this be related to slowness/constant freezing?

[Error - 7:12:13 PM] 2024/06/18 19:12:13 tidy: diagnosing file:///D:/Work/storyden/go.mod: err: exit status 1: stderr: go: downloading golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
go: github.com/Southclaws/storyden imports
    github.com/a8m/enter imports
    entgo.io/ent/entc imports
    golang.org/x/tools/go/packages: module lookup disabled by GOPROXY=off
quick iris
#

pass, but GOPROXY=off certainly isnt a default setting