Skip to content

Commit

Permalink
Build all commands at the same time
Browse files Browse the repository at this point in the history
In Go it's much more efficient to build several commands in the same
`go build` because the build has to load most of the dependency tree
each time.  Roughly 50% on my machine:

Together (go1.2 on OS X):

    real  0m4.049s
    user  0m8.387s
    sys   0m2.766s

Separate:

    real  0m13.392s
    user  0m12.420s
    sys   0m6.882s
  • Loading branch information
smarterclayton committed Jul 25, 2014
1 parent bb1d362 commit 8991277
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions hack/build-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,4 @@ if [ $# -gt 0 ]; then
BINARIES="$@"
fi

for b in $BINARIES; do
echo "+++ Building ${b}"
go build "${KUBE_GO_PACKAGE}"/cmd/${b}
done
go build $(for b in $BINARIES; do echo "${KUBE_GO_PACKAGE}"/cmd/${b}; done)

0 comments on commit 8991277

Please sign in to comment.