1
0
mirror of https://github.com/golang/go synced 2024-11-18 08:04:40 -07:00

cmd/dist: respect runtime.NumCPU when bootstrapping arm hosts

This is a reproposal of CL 2957. This reproposal restricts the
scope of this change to just arm systems.

With respect to rsc's comments on 2957, on all my arm hosts they perform
the build significantly faster with this change in place.

Change-Id: Ie09be1a73d5bb777ec5bca3ba93ba73d5612d141
Reviewed-on: https://go-review.googlesource.com/5834
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Dave Cheney 2015-02-25 10:59:20 +11:00
parent e31e35a0de
commit 7ce0261387

View File

@ -436,7 +436,7 @@ func main() {
}
if gohostarch == "arm" {
maxbg = 1
maxbg = min(maxbg, runtime.NumCPU())
}
bginit()
@ -544,3 +544,10 @@ func xgetgoarm() string {
}
return goarm
}
func min(a, b int) int {
if a < b {
return a
}
return b
}