Commit 7ce02613 authored by Dave Cheney's avatar Dave Cheney

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/5834Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent e31e35a0
......@@ -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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment