]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: respect runtime.NumCPU when bootstrapping arm hosts
authorDave Cheney <dave@cheney.net>
Tue, 24 Feb 2015 23:59:20 +0000 (10:59 +1100)
committerDave Cheney <dave@cheney.net>
Wed, 25 Feb 2015 00:15:12 +0000 (00:15 +0000)
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>
src/cmd/dist/util.go

index 12e14d3ae5054bfa8e8f3f7eb3be5c22f65954c1..d7e0078c2f635dc4f9ba2cb6b49c3500249b0b27 100644 (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
+}