Skip to content

build: compilation considerably slower compared to 1.4 #10765

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

Closed
awly opened this issue May 9, 2015 · 3 comments
Closed

build: compilation considerably slower compared to 1.4 #10765

awly opened this issue May 9, 2015 · 3 comments
Milestone

Comments

@awly
Copy link
Contributor

awly commented May 9, 2015

Compilation times even for trivial programs have regressed quite noticeably since 1.4
Example:

$ go version
go version devel +2d9a50b Fri May 8 19:10:10 2015 +0000 darwin/amd64

$ ~/.go1.4/bin/go version
go version go1.4.1 darwin/amd64

$ time go build -v -x
WORK=/var/folders/vg/njvw3b2118z775q_7hp6c_1h0000gn/T/go-build986103443
github.com/alytvynov/notify
mkdir -p $WORK/github.com/alytvynov/notify/_obj/
mkdir -p $WORK/github.com/alytvynov/notify/_obj/exe/
cd /Users/cronos/go/src/github.com/alytvynov/notify
/Users/cronos/.go/pkg/tool/darwin_amd64/6g -o $WORK/github.com/alytvynov/notify.a -trimpath $WORK -p main -complete -D _/Users/cronos/go/src/github.com/alytvynov/notify -I $WORK -pack ./notify.go
cd .
/Users/cronos/.go/pkg/tool/darwin_amd64/6l -o $WORK/github.com/alytvynov/notify/_obj/exe/a.out -L $WORK -extld=clang -buildmode=exe $WORK/github.com/alytvynov/notify.a
mv $WORK/github.com/alytvynov/notify/_obj/exe/a.out notify

real    0m0.703s
user    0m0.587s
sys 0m0.103s

$ time GOROOT=~/.go1.4 ~/.go1.4/bin/go build -v -x
WORK=/var/folders/vg/njvw3b2118z775q_7hp6c_1h0000gn/T/go-build023012609
github.com/alytvynov/notify
mkdir -p $WORK/github.com/alytvynov/notify/_obj/
mkdir -p $WORK/github.com/alytvynov/notify/_obj/exe/
cd /Users/cronos/go/src/github.com/alytvynov/notify
/Users/cronos/.go1.4/pkg/tool/darwin_amd64/6g -o $WORK/github.com/alytvynov/notify.a -trimpath $WORK -p github.com/alytvynov/notify -complete -D _/Users/cronos/go/src/github.com/alytvynov/notify -I $WORK -pack ./notify.go
cd .
/Users/cronos/.go1.4/pkg/tool/darwin_amd64/6l -o $WORK/github.com/alytvynov/notify/_obj/exe/a.out -L $WORK -extld=clang $WORK/github.com/alytvynov/notify.a
mv $WORK/github.com/alytvynov/notify/_obj/exe/a.out notify

real    0m0.230s
user    0m0.173s
sys 0m0.043s

This is 0.7s on tip vs 0.23s on 1.4.

For other larger project (which is unfortunately not open-source) i get 2.57s vs 0.9s

This might be related to compiler translation to Go.

@minux minux added this to the Go1.5 milestone May 9, 2015
@minux
Copy link
Member

minux commented May 9, 2015 via email

@robpike
Copy link
Contributor

robpike commented May 10, 2015

This is really #10571. Closing. Let's not have multiple bugs tracking the work.

@anacrolix
Copy link
Contributor

I think #10571 is only a symptom of this.

@golang golang locked and limited conversation to collaborators Oct 4, 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

5 participants