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

suggest is too slow #281

Closed
liuwangchen opened this issue Jul 4, 2020 · 6 comments
Closed

suggest is too slow #281

liuwangchen opened this issue Jul 4, 2020 · 6 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@liuwangchen
Copy link

why the suggest is too slow? did this plugin index symbol like goland?why goland suggest is too fast?

@hyangah
Copy link
Contributor

hyangah commented Jul 4, 2020

@liuwangchen Please answer the followings so we can investigate. Thanks!

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
  • Check your installed extensions to get the version of the VS Code Go extension
  • Run go env to get the go development environment details

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.

Describe the bug

A clear and concise description of what the bug.
A clear and concise description of what you expected to happen.

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. See error

Screenshots or recordings

If applicable, add screenshots or recordings to help explain your problem.

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jul 4, 2020
@oxycoder
Copy link

oxycoder commented Jul 4, 2020

The default index is very very slow.

But there is an option allow you to switch to gopls for code navigation, suggestion...
Go to Settings, search for "gopls", then check the boxes, then install gopls.

Note: gopls is disabled by default

@liuwangchen
Copy link
Author

"go.autocompleteUnimportedPackages": false,
"[go]": {
    "editor.insertSpaces": false,
    "editor.formatOnSave": false,
    "editor.codeActionsOnSave": {
        "source.fixAll": false,
        "source.organizeImports": true
    },
},
"gopls": {
    "usePlaceholders": true,
    "completeUnimported": true,
},
"go.lintTool": "golangci-lint",
"go.lintOnSave": "off",
"go.useLanguageServer": true,
"go.languageServerExperimentalFeatures": {
    "diagnostics": false,
    "documentLink": false
},
"go.formatTool": "goimports",
"go.addTags": {
    "tags": "json,form",
    "options": "json=omitempty",
    "promptForTags": false,
    "transform": "snakecase"
},

➜ ~ go version
go version go1.14.3 darwin/amd64

➜ ~ code -v
1.46.1
cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
x64

➜ ~ go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN="/Users/liuwangchen/work/go/gopath/bin"
GOCACHE="/Users/liuwangchen/Library/Caches/go-build"
GOENV="/Users/liuwangchen/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/liuwangchen/work/go/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/zc/phwpq1lx3kg75wycm7_krd0m0000gn/T/go-build418433688=/tmp/go-build -gno-record-gcc-switches -fno-common

@hyangah

@liuwangchen
Copy link
Author

I have tried many ways to increase the speed of gopls, but when the project is large, it becomes extremely slow. How does goland do it so fast?

@liuwangchen
Copy link
Author

The default index is very very slow.

But there is an option allow you to switch to gopls for code navigation, suggestion...
Go to Settings, search for "gopls", then check the boxes, then install gopls.

Note: gopls is disabled by default

No, my configuration is already useLanguageServer

@liuwangchen liuwangchen reopened this Jul 5, 2020
@hyangah
Copy link
Contributor

hyangah commented Jul 5, 2020

@liuwangchen Thanks for sharing the settings. Can you provide a specific repro case?

There are a couple of issues about improving gopls scalability and performance (e.g. golang/go#37790, golang/go#37670, ...).

In general, there are multiple factors that affect the performance of the program (e.g. scale, misconfiguration, source code layout, other extensions&tools, cpu/memory, ...). We are happy to look into the problem if there are a repro case and objective goals to identify and address the source of the specific problem you are experiencing.

Re: the goland implementation details, we don't have access to its internals, so I think your question can be better answered in the goland discussion forum.

@golang golang locked and limited conversation to collaborators Jul 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants