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

cmd/go: add duration on each -x of go build to know which pkg that slow #37591

Closed
kokizzu opened this issue Mar 1, 2020 · 4 comments
Closed
Labels
FeatureRequest FrozenDueToAge GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@kokizzu
Copy link

kokizzu commented Mar 1, 2020

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)

@dmitshur dmitshur changed the title 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 Mar 1, 2020
@dmitshur dmitshur added FeatureRequest GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Mar 1, 2020
@dmitshur dmitshur added this to the Backlog milestone Mar 1, 2020
@dmitshur
Copy link
Contributor

dmitshur commented Mar 1, 2020

/cc @bcmills @matloob @jayconrod

@bcmills
Copy link
Contributor

bcmills commented 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
Copy link
Contributor

bcmills commented 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.

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 6, 2020
@kokizzu
Copy link
Author

kokizzu commented Mar 6, 2020

nice, never know there was this flag, thanks.

@kokizzu kokizzu closed this as completed Mar 6, 2020
@golang golang locked and limited conversation to collaborators Mar 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. 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