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: 100% CPU utilization with soft links #40342

Open
silentred opened this issue Jul 22, 2020 · 0 comments
Open

x/tools/gopls: 100% CPU utilization with soft links #40342

silentred opened this issue Jul 22, 2020 · 0 comments

Comments

@silentred
Copy link

@silentred silentred commented Jul 22, 2020

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

$ go version
go version go1.13.12 darwin/amd64

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

go env Output
$ go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jason/Library/Caches/go-build"
GOENV="/Users/jason/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/jason/Desktop/projects/GOPATH"
GOPRIVATE=""
GOPROXY=""
GOROOT="/usr/local/opt/go@1.13/libexec"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go@1.13/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/jason/Desktop/projects/xxx/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/z5/6kmls3wj45v9f0c456grhdnc0000gn/T/go-build577824137=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

My go project dir is /my-project. In this dir, there is a webui sub dir, witch is initialized with npm. When I open VSCode to do changes on /my-project, gopls process keeps running at 700% CPU utility.

I used go pprof to generate a flame graph. There were lots of CPU running at filepath.EvalSymlinks and os.Stat. I guess it has something to do with node_modules. I moved webui dir out of /my-project, then CPU utility dropped to normal.

I hope gopls could support excluding files like vscode does. And I see a issue with the same request. #37697
#37697

The profiling file is attached.
pprof.samples.cpu.002.pb.gz

image

@gopherbot gopherbot added this to the Unreleased milestone Jul 22, 2020
@stamblerre stamblerre changed the title x/tools/gopls: CPU 100% with soft links x/tools/gopls: 100% CPU utilization with soft links Jul 23, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v1.0.0 Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.