Please sign in to comment.
compiling: Add -i flag to go build to speed up builds
So builds take about 30s on my shitty machine which is pretty long. Turns out golang caches things in $GOPATH/pkg/ but is not clever enough to erase things from there that are out of date. As a result, it was rebuilding everything (including the unchanged dependencies) every build! By completely wiping out $GOPATH/pkg/ and then running `go build -i`, this now takes builds down to about 8 seconds. (After one full build is finished.) This is basically the same as running `go install`, but without copying junk to $GOPATH/bin. Hopefully the tooling will be smart enough to know when to throw out stuff in $GOPATH/pkg automatically and avoid this problem entirely. Is it wrong to send Google a bill for all the extra cpu cycles I've used? ;)
- Loading branch information...