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/compile: 1.5 Beta 2: Compilation seems significantly slower and less efficient than 1.4 #11859

Closed
aviflax opened this issue Jul 24, 2015 · 5 comments
Milestone

Comments

@aviflax
Copy link

aviflax commented Jul 24, 2015

What version of Go are you using (go version)?

go version go1.5beta2 darwin/amd64 installed via the installer downloaded from golang.org and go version go1.4.2 darwin/amd64 installed by Homebrew (IIRC).

What operating system and processor architecture are you using?

Mac OS X 10.10.4, amd64

What did you do?

Compiled my program with 1.5 beta 2.

What did you expect to see?

Compilation times that would be less than 2x those of 1.4.2.

What did you see instead?

$ GOPATH=`godep path`:$GOPATH time go15 build ./...
       12.54 real        31.73 user         5.14 sys
$ GOPATH=`godep path`:$GOPATH time go15 build ./...
       12.39 real        31.76 user         5.08 sys
$ rm -Rf `godep path`/pkg/* $GOPATH/pkg/*
$ GOPATH=`godep path`:$GOPATH time go14 build ./...
        5.18 real         9.51 user         2.25 sys
$ GOPATH=`godep path`:$GOPATH time go14 build ./...
        4.66 real         9.49 user         2.12 sys
@ALTree
Copy link
Member

ALTree commented Jul 24, 2015

What did you expect to see?
Compilation times that would be less than 2x those of 1.4.2.

Unfortunately this won't be true for go 1.5. From the release notes:

Builds in Go 1.5 will be slower by a factor of about two.

So the slowdown you are seeing is expected.

@aviflax
Copy link
Author

aviflax commented Jul 24, 2015

@ALTree I’m not good with math, but 12.39 seems like way more than double 4.66. And the CPU usage! I’m worried about my battery life!

@josharian
Copy link
Contributor

@aviflax 2x is not a hard and fast number. If you were experiencing a 20x slowdown, this would be more pressing, but 2.65x is not dramatically out of range. (And yes, the slowdown is very unfortunate. I am not happy about it either.) All that said, is your program available somewhere? I doubt that there is anything safe that could be done to address it at this point in the release cycle, but if we can reproduce it, that'll help with Go 1.6 speed-up efforts.

@aviflax
Copy link
Author

aviflax commented Jul 24, 2015

@josharian TBH, I figured. I still thought it might be helpful to report what I’m seeing. Unfortunately this is a private and proprietary program; I can’t share its source without at least an NDA and certainly not publicly. If it helps, according to cloc it has 121,123 lines of code (excluding comments and blanks) across 1,059 files. That’s including all vendored dependencies — as far as I can tell it excludes only the standard library. And I’m pretty sure all those files are included in compilation — we use Godep and I think it only includes the specific packages that our program actually uses.

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jul 24, 2015
@ianlancetaylor ianlancetaylor changed the title 1.5 Beta 2: Compilation seems significantly slower and less efficient than 1.4 cmd/compile: 1.5 Beta 2: Compilation seems significantly slower and less efficient than 1.4 Jul 24, 2015
@josharian
Copy link
Contributor

Ok, thanks. The LOC count doesn't matter as much as what the actual lines are. :) If you want to poke at it more, you can run the compiler and linker with cpu and memory profiling enabled and share your findings in case there is anything usual. However, given the slowdown level you report, I'd guess that there's nothing peculiar to your code base. I'm going to close this for now. Feel free to reopen if you have significant new info.

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