Skip to content

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

Closed
@kokizzu

Description

@kokizzu

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)

Activity

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[/+] on Mar 1, 2020
added
FeatureRequestIssues asking for a new feature that does not need a proposal.
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on Mar 1, 2020
added this to the Backlog milestone on Mar 1, 2020
dmitshur

dmitshur commented on Mar 1, 2020

@dmitshur
Member
bcmills

bcmills commented on Mar 2, 2020

@bcmills
Contributor

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

bcmills commented on Mar 6, 2020

@bcmills
Contributor

@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.

added
WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
on Mar 6, 2020
kokizzu

kokizzu commented on Mar 6, 2020

@kokizzu
Author

nice, never know there was this flag, thanks.

locked and limited conversation to collaborators on Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.FrozenDueToAgeGoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @kokizzu@dmitshur@bcmills@gopherbot

        Issue actions

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