Skip to content

Commit 7ce0261

Browse files
committedFeb 25, 2015
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 <[email protected]>
1 parent e31e35a commit 7ce0261

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎src/cmd/dist/util.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ func main() {
436436
}
437437

438438
if gohostarch == "arm" {
439-
maxbg = 1
439+
maxbg = min(maxbg, runtime.NumCPU())
440440
}
441441
bginit()
442442

@@ -544,3 +544,10 @@ func xgetgoarm() string {
544544
}
545545
return goarm
546546
}
547+
548+
func min(a, b int) int {
549+
if a < b {
550+
return a
551+
}
552+
return b
553+
}

0 commit comments

Comments
 (0)
Please sign in to comment.