mirror of
https://github.com/golang/go
synced 2024-11-18 10:24:42 -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:
parent
e31e35a0de
commit
7ce0261387
9
src/cmd/dist/util.go
vendored
9
src/cmd/dist/util.go
vendored
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user