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: build, generate, and test all take more than twice as long in go1.5 on darwin/amd64 #12211

Closed
mdwhatcott opened this issue Aug 19, 2015 · 2 comments

Comments

@mdwhatcott
Copy link

I noticed this a few weeks ago on release candidate 1 as well as the official go 1.5 release. Running actions like go build, go generate, and go test takes twice as long in go 1.5 as compared to go 1.4.2.

I've run this test several times, installing go 1.5, then moving back to go 1.4. Each time I saw consistently slower results on go 1.5.

Wondering if there is any hope of speeding up the go toolchain to pre 1.5 speeds?


Execution time in seconds for go test, go generate, and go build:

action/version go1.4 go1.5
go build .971 2.441
go generate .599 1.334
go test 1.572 4.571
all the above 3.488 6.862

Here's my environment:

$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/mike"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT=""
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"

Here's the detailed output showing timing results for go 1.4.2 vs. go 1.5

$ go version
go version go1.4.2 darwin/amd64

$ rm -rf $GOPATH/pkg

$ time go build ./...
real    0m0.971s
user    0m1.890s
sys 0m0.396s

$ time go generate ./...
real    0m0.599s
user    0m0.416s
sys 0m0.182s

$ time go test ./...
real    0m1.572s
user    0m7.599s
sys 0m1.375s

$ time make
go build ./...
go generate ./...
go test ./...

real    0m3.488s
user    0m10.283s
sys 0m2.040s

============================================

$ go version
go version go1.5 darwin/amd64

$ rm -rf $GOPATH/pkg

$ time go build ./...
real    0m2.441s
user    0m7.166s
sys 0m1.219s

$ time go generate ./...
real    0m1.334s
user    0m1.247s
sys 0m0.404s

$ time go test ./...
real    0m4.571s
user    0m26.083s
sys 0m3.685s

$ time make
go build ./...
go generate ./...
go test ./...

real    0m6.862s
user    0m32.500s
sys 0m4.845s

@bradfitz
Copy link
Contributor

Yes, this is a known issue and will be addressed in the following releases to restore the speed. It was an unfortunate side-effect of the automated translation from C to Go.

@cespare
Copy link
Contributor

cespare commented Aug 19, 2015

Is there an issue that tracks this compiler performance regression? (Kind of like #6853).

@mikioh mikioh changed the title go tool (v1.5): build, generate, and test all take more than twice as long (darwin/amd64) cmd/go: build, generate, and test all take more than twice as long in go1.5 on darwin/amd64 Aug 21, 2015
@golang golang locked and limited conversation to collaborators Aug 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants