Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

gometalinter performance problems #980

Closed
damienstanton opened this issue May 8, 2017 · 4 comments
Closed

gometalinter performance problems #980

damienstanton opened this issue May 8, 2017 · 4 comments

Comments

@damienstanton
Copy link

damienstanton commented May 8, 2017

I am using plugin 0.6.61, VSCode 1.12.1, macOS 10.12.4, Go 1.8.1.

Gometalinter seems to take more than 20-30 seconds to run over a given .go file, and it reduces overall editor performance to a sluggish pace, where keystrokes take a full second or more to register. Changing to a new file, I still see the linter warnings/errs for the old file.

Switching the configuration to use golint as the linter instead restores performance to near-realtime.

Is there a way we can detect which linters are making gometalinter so slow? I have tried disabling specific linters one by one via flags in the config but it is still badly underperforming.

There are no obvious errors in the dev tools, and it appears that it's only gometalinter that's bogging down.

These are my only current configs:

  "go.formatTool": "goimports",
  "go.formatOnSave": true,
  "go.lintOnSave": true,
  "go.lintTool": "gometalinter",
  "go.docsTool": "gogetdoc",
@ramya-rao-a
Copy link
Contributor

There is a --fast flag that you can pass in the go.lintFlags which when used with go.lintTool:gometalinter apparently runs only the fast linters in gometalinter.

Unfortunately there is nothing more the Go extension can do here, other than rely on the user's knowledge of how best to use gometalinter

@damienstanton
Copy link
Author

Interesting, I did not know about that flag. Thanks!

@amativos
Copy link

amativos commented Jun 6, 2017

Does the extension provide a way to run linter on demand? That way we could run gometalinter with expensive linters only when we choose to, without falling back to the command line. As far as I checked, there is no way to do this.

@ramya-rao-a
Copy link
Contributor

@amativos You can set go.lintOnSave to false (if you are on a version below 0.6.62) or off (if you are on version 0.6.62 or above), and then turn it on again when you want to run the linter.

#287 is tracking the feature to have build/lint/install as commands, so add your thoughts there as well.

I am planning to get to that in the next month or so

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants