From 899127701edefc682d5198c0ca141a35ccc7fd09 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Fri, 25 Jul 2014 13:23:23 -0400 Subject: [PATCH] Build all commands at the same time 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 --- hack/build-go.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hack/build-go.sh b/hack/build-go.sh index 4b41ec128a9..9f9c7e85cc7 100755 --- a/hack/build-go.sh +++ b/hack/build-go.sh @@ -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) \ No newline at end of file