Closed
Description
What version of Go are you using (go version
)?
$ go version go version go1.14 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/kyz/.cache/go-build" GOENV="/home/kyz/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/kyz/MEGA/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/lib/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" 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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build483691684=/tmp/go-build -gno-record-gcc-switches"
What did you do?
compile a project
What did you expect to see?
compiled fast
What did you see instead?
took 13s-ish each time code changed using SSD and i7-4770HQ
it would be nice if we could see time of each -x flag to see which part or pkg causes slowdown (especially more detailed on linking part)
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
[-]cmd: feature request: add duration on each -x of go build to know which pkg that slow[/-][+]cmd/go: add duration on each -x of go build to know which pkg that slow[/+]dmitshur commentedon Mar 1, 2020
/cc @bcmills @matloob @jayconrod
bcmills commentedon Mar 2, 2020
See #15736 (comment).
We could perhaps also emit timing information, although I'm not sure it's all that useful independent of the action graph: since steps can and do occur in parallel, the step that takes the longest is not necessarily the bottleneck. (That said, the bottleneck is almost always linking the final executable, often with the system linker.)
bcmills commentedon Mar 6, 2020
@kokizzu, does
-debug-actiongraph
address your use-case? Otherwise, it's not at all clear to me how this would help for builds with non-trivial parallelism.kokizzu commentedon Mar 6, 2020
nice, never know there was this flag, thanks.