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

Performance is down after upgrading to macOS Sierra. #503

Closed
q45 opened this issue Sep 26, 2016 · 32 comments
Closed

Performance is down after upgrading to macOS Sierra. #503

q45 opened this issue Sep 26, 2016 · 32 comments

Comments

@q45
Copy link

q45 commented Sep 26, 2016

Seems like after opened for awhile godef and golint really ramp up on CPU.

@troylelandshields
Copy link

+1 I also have this issue. Didn't start for me until I updated to Macos Sierra.

Please don't make me switch to Sublime 😢

@q45
Copy link
Author

q45 commented Sep 26, 2016

I started using sublime again because of this and it makes me really sad as well.

@q45
Copy link
Author

q45 commented Sep 26, 2016

godef 63.7 CPU
gocode 63.7 CPU
godef 63.4 CPU

@c4milo
Copy link

c4milo commented Sep 27, 2016

I'm experiencing something similar, multiple godoc processes, each one consuming ~45% of CPU

@BramGruneir
Copy link

They don't even close down on their own after closing vscode for a while.

screen shot 2016-09-28 at 16 29 32

@q45
Copy link
Author

q45 commented Sep 28, 2016

I have to go and constantly kill the process with the activity monitor

@lukehoban
Copy link
Contributor

Are folks who are seeing this using Go 1.6 or earlier? Looks like there is a serious issue with Go pre-1.7 on Sierra that are likely related.

golang/go#16354

@c4milo
Copy link

c4milo commented Sep 28, 2016

I'm using Go 1.7

@q45
Copy link
Author

q45 commented Sep 28, 2016

go 1.7.1

@troylelandshields
Copy link

go version go1.7

@BramGruneir
Copy link

go 1.7.1

@BramGruneir
Copy link

I think I've discovered the cause of the error. Go needs to be recompiled from source to work with Sierra. Specifically, the gotools to fix this issue.
However doing so is not easy right now, see golang/go#16352

To fix this, I took go's 1.4.3 source, compiled it using the cherry-picked suggestions from the issue (it fails some tests, but works fine as a bootstrapper) and the recompiled 1.7.1 using that newly compiled 1.4.3 bootstrapper.

This completely fixed this issue for me.

@BramGruneir
Copy link

Sadly, I have to report that there are less godefs running, but it didn't completely eliminate the problem.

@stephbu
Copy link

stephbu commented Sep 30, 2016

Brew upgrading 1.6 > 1.7.1 reduced the number of orphaned go/godef/gocode instances running by a lot, but left one residual go instance running at ~68% CPU on a MBPR. On battery this turning the typical 8hr experience into ~60mins of lap warming.

@troylelandshields
Copy link

I have a friend that uses Atom and he is having similar issues, so it might be something with the Go tools themselves.

@tecbot
Copy link

tecbot commented Oct 6, 2016

I had the same problem after upgrading to Sierra and go1.7. I reinstalled every tool (godef, goreturns etc) and the issue was gone. The old compiled binaries aren't 100% compatible with Sierra.

@tclass
Copy link

tclass commented Oct 6, 2016

@tecbot did the same and worked! 👍

@lukehoban
Copy link
Contributor

@tecbot Great to hear. Hope that this solves others' problems as well.

@troylelandshields Yes, this issue isn't going to be specific to VSCode - it's a problem with Go and the Go tools that are used by the editor extensions. I expect users of any editor which uses these tools will have similar issues.

@q45
Copy link
Author

q45 commented Oct 6, 2016

@tecbot could you explain exactly how you did that. Thanks

@tclass
Copy link

tclass commented Oct 7, 2016

@q45 just use this snippet, if you have other gotools that also use 100% CPU, just update them like this.

go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/newhook/go-symbols
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v github.com/cweill/gotests/...

@ramya-rao-a
Copy link
Contributor

You could also run the command Go: Install Tools This will install/update all the tools used by the Go extension

@ramya-rao-a
Copy link
Contributor

Closing this as re-installing all the Go tools solves the problem.

If anyone still sees this issue with Go 1.7 and Sierra, please feel free to re-open this issue

@gertcuykens
Copy link
Contributor

gertcuykens commented Nov 8, 2016

hmm could it be there are also issues with go get itself?

OSX 10.12.1
git version 2.9.3 (Apple Git-75)

go env
GOARCH="amd64"
GOBIN="/Users/gert/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/gert/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.7.1/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7.1/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/dv/8tlwvjr91zjdyq4rk14lkkfm0000gn/T/go-build584711619=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
Installing gocode SUCCEEDED
Installing gopkgs SUCCEEDED
Installing godef SUCCEEDED
Installing go-outline SUCCEEDED
Installing go-symbols FAILED
Installing guru FAILED
Installing gorename FAILED
Installing goreturns FAILED
Installing golint FAILED
Installing gotests FAILED

go-symbols:
Error: Command failed: go get -u -v github.com/newhook/go-symbols
github.com/newhook/go-symbols (download)
Fetching https://golang.org/x/tools/go/buildutil?go-get=1
Parsing meta tags from https://golang.org/x/tools/go/buildutil?go-get=1 (status code 200)
get "golang.org/x/tools/go/buildutil": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/buildutil?go-get=1
get "golang.org/x/tools/go/buildutil": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
# cd /Users/gert/go/src/golang.org/x/tools; git pull --ff-only
From https://go.googlesource.com/tools
   46c63f3..09079c8  master     -> origin/master
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/tools/go/buildutil: exit status 1
github.com/newhook/go-symbols (download)
Fetching https://golang.org/x/tools/go/buildutil?go-get=1
Parsing meta tags from https://golang.org/x/tools/go/buildutil?go-get=1 (status code 200)
get "golang.org/x/tools/go/buildutil": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/buildutil?go-get=1
get "golang.org/x/tools/go/buildutil": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
# cd /Users/gert/go/src/golang.org/x/tools; git pull --ff-only
From https://go.googlesource.com/tools
   46c63f3..09079c8  master     -> origin/master
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/tools/go/buildutil: exit status 1

guru:
Error: Command failed: go get -u -v golang.org/x/tools/cmd/guru
Fetching https://golang.org/x/tools/cmd/guru?go-get=1
Parsing meta tags from https://golang.org/x/tools/cmd/guru?go-get=1 (status code 200)
get "golang.org/x/tools/cmd/guru": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/guru?go-get=1
get "golang.org/x/tools/cmd/guru": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
# cd /Users/gert/go/src/golang.org/x/tools; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/tools/cmd/guru: exit status 1
Fetching https://golang.org/x/tools/cmd/guru?go-get=1
Parsing meta tags from https://golang.org/x/tools/cmd/guru?go-get=1 (status code 200)
get "golang.org/x/tools/cmd/guru": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/guru?go-get=1
get "golang.org/x/tools/cmd/guru": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
# cd /Users/gert/go/src/golang.org/x/tools; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/tools/cmd/guru: exit status 1

gorename:
Error: Command failed: go get -u -v golang.org/x/tools/cmd/gorename
Fetching https://golang.org/x/tools/cmd/gorename?go-get=1
Parsing meta tags from https://golang.org/x/tools/cmd/gorename?go-get=1 (status code 200)
get "golang.org/x/tools/cmd/gorename": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/gorename?go-get=1
get "golang.org/x/tools/cmd/gorename": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
# cd /Users/gert/go/src/golang.org/x/tools; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/tools/cmd/gorename: exit status 1
Fetching https://golang.org/x/tools/cmd/gorename?go-get=1
Parsing meta tags from https://golang.org/x/tools/cmd/gorename?go-get=1 (status code 200)
get "golang.org/x/tools/cmd/gorename": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/gorename?go-get=1
get "golang.org/x/tools/cmd/gorename": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
# cd /Users/gert/go/src/golang.org/x/tools; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/tools/cmd/gorename: exit status 1

goreturns:
Error: Command failed: go get -u -v sourcegraph.com/sqs/goreturns
Fetching https://sourcegraph.com/sqs/goreturns?go-get=1
Parsing meta tags from https://sourcegraph.com/sqs/goreturns?go-get=1 (status code 200)
get "sourcegraph.com/sqs/goreturns": found meta tag main.metaImport{Prefix:"sourcegraph.com/sqs/goreturns", VCS:"git", RepoRoot:"https://github.com/sqs/goreturns"} at https://sourcegraph.com/sqs/goreturns?go-get=1
sourcegraph.com/sqs/goreturns (download)
Fetching https://golang.org/x/tools/imports?go-get=1
Parsing meta tags from https://golang.org/x/tools/imports?go-get=1 (status code 200)
get "golang.org/x/tools/imports": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/imports?go-get=1
get "golang.org/x/tools/imports": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
# cd /Users/gert/go/src/golang.org/x/tools; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/tools/imports: exit status 1
Fetching https://sourcegraph.com/sqs/goreturns/returns?go-get=1
Parsing meta tags from https://sourcegraph.com/sqs/goreturns/returns?go-get=1 (status code 200)
get "sourcegraph.com/sqs/goreturns/returns": found meta tag main.metaImport{Prefix:"sourcegraph.com/sqs/goreturns", VCS:"git", RepoRoot:"https://github.com/sqs/goreturns"} at https://sourcegraph.com/sqs/goreturns/returns?go-get=1
get "sourcegraph.com/sqs/goreturns/returns": verifying non-authoritative meta tag
Fetching https://sourcegraph.com/sqs/goreturns?go-get=1
Parsing meta tags from https://sourcegraph.com/sqs/goreturns?go-get=1 (status code 200)
Fetching https://sourcegraph.com/sqs/goreturns?go-get=1
Parsing meta tags from https://sourcegraph.com/sqs/goreturns?go-get=1 (status code 200)
get "sourcegraph.com/sqs/goreturns": found meta tag main.metaImport{Prefix:"sourcegraph.com/sqs/goreturns", VCS:"git", RepoRoot:"https://github.com/sqs/goreturns"} at https://sourcegraph.com/sqs/goreturns?go-get=1
sourcegraph.com/sqs/goreturns (download)
Fetching https://golang.org/x/tools/imports?go-get=1
Parsing meta tags from https://golang.org/x/tools/imports?go-get=1 (status code 200)
get "golang.org/x/tools/imports": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/imports?go-get=1
get "golang.org/x/tools/imports": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
# cd /Users/gert/go/src/golang.org/x/tools; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/tools/imports: exit status 1
Fetching https://sourcegraph.com/sqs/goreturns/returns?go-get=1
Parsing meta tags from https://sourcegraph.com/sqs/goreturns/returns?go-get=1 (status code 200)
get "sourcegraph.com/sqs/goreturns/returns": found meta tag main.metaImport{Prefix:"sourcegraph.com/sqs/goreturns", VCS:"git", RepoRoot:"https://github.com/sqs/goreturns"} at https://sourcegraph.com/sqs/goreturns/returns?go-get=1
get "sourcegraph.com/sqs/goreturns/returns": verifying non-authoritative meta tag
Fetching https://sourcegraph.com/sqs/goreturns?go-get=1
Parsing meta tags from https://sourcegraph.com/sqs/goreturns?go-get=1 (status code 200)

golint:
Error: Command failed: go get -u -v github.com/golang/lint/golint
github.com/golang/lint (download)
Fetching https://golang.org/x/tools/go/gcimporter15?go-get=1
Parsing meta tags from https://golang.org/x/tools/go/gcimporter15?go-get=1 (status code 200)
get "golang.org/x/tools/go/gcimporter15": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/gcimporter15?go-get=1
get "golang.org/x/tools/go/gcimporter15": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
# cd /Users/gert/go/src/golang.org/x/tools; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/tools/go/gcimporter15: exit status 1
github.com/golang/lint (download)
Fetching https://golang.org/x/tools/go/gcimporter15?go-get=1
Parsing meta tags from https://golang.org/x/tools/go/gcimporter15?go-get=1 (status code 200)
get "golang.org/x/tools/go/gcimporter15": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/gcimporter15?go-get=1
get "golang.org/x/tools/go/gcimporter15": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
# cd /Users/gert/go/src/golang.org/x/tools; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/tools/go/gcimporter15: exit status 1

gotests:
Error: Command failed: go get -u -v github.com/cweill/gotests/...
github.com/cweill/gotests (download)
Fetching https://golang.org/x/tools/imports?go-get=1
Parsing meta tags from https://golang.org/x/tools/imports?go-get=1 (status code 200)
get "golang.org/x/tools/imports": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/imports?go-get=1
get "golang.org/x/tools/imports": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
# cd /Users/gert/go/src/golang.org/x/tools; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/tools/imports: exit status 1
github.com/cweill/gotests (download)
Fetching https://golang.org/x/tools/imports?go-get=1
Parsing meta tags from https://golang.org/x/tools/imports?go-get=1 (status code 200)
get "golang.org/x/tools/imports": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/imports?go-get=1
get "golang.org/x/tools/imports": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
# cd /Users/gert/go/src/golang.org/x/tools; git pull --ff-only
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

package golang.org/x/tools/imports: exit status 1

@gertcuykens
Copy link
Contributor

never mind removing golang.org/x/tools/ to fix the above

@archerbj
Copy link

@ramya-rao-a hi , i just ran into this problem. It is embarrassing to say but i really can't find where to run the command.
Should i literally run GO: install tools ? or go install the tools separately

@ramya-rao-a
Copy link
Contributor

@archerbj Not a problem at all.

You need to run the command from the command pallet. So

  • Cmd+Shift+P to open the command pallet.
  • Then type Go: Install Tools, hit ENTER.

@archerbj
Copy link

@ramya-rao-a Thanks a lot !

@zegl
Copy link

zegl commented Feb 13, 2017

I recently encountered this issue after upgrading to MacOS Sierra.

Why can the extension not notify the users to run Go: Install Tools if the editor suspects that some tools needs to be upgraded/reinstalled?

As a user I'd like the editor/plugin to either solve these issues by itself or to notify me what I can do to solve it.

@ramya-rao-a
Copy link
Contributor

Users don't need to update the tools every time an update is available.

One thing we can do is to prompt to update when the Go version used by the user changes.

Any other ideas?

@gertcuykens
Copy link
Contributor

gertcuykens commented Feb 14, 2017

Hmm I personally would leave it as it is and just point it out in the docs. Also please create a new issue for it if you believe it needs to be a new feature.

@c4milo
Copy link

c4milo commented Feb 14, 2017

@ramya-rao-a I would appreciate the prompt as I constantly switch my Go version underneath when testing new Go releases and it breaks vscode every time.

@ramya-rao-a
Copy link
Contributor

@c4milo #797 has been created for this. Please share your thoughts/upvotes there.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 23, 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