I have a Go program that uses the Qt wrapper library https://github.com/therecipe/qt. Unfortunately, the build time gets extremely high with it (assuming it's the go part)
go build -i . // takes about 14 seconds
go run . // takes about 8 seconds
After running either of the above commands I get the pre-compiled dependencies in my $GOPATH/pkg/linux_amd64/github.com/therecipe/qt
as .a
files so they are not rebuilding each time.
I've tried to use ccache
and Gold linker /usr/bin/ld.gold
as described in https://github.com/therecipe/qt/wiki/Faster-builds-(Linux) but it didn't improve anything. Also this Qt wrapper ships with its own build tool qtdeploy
which I tried but it is roughly the same build time.
System I'm running on:
go version go1.14.4 linux/amd64
Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
16GB Ram
Would anyone know if it's possible to improve the build time at least a bit?
EDIT:
Running go build -x .
shows that the biggest time consumer is the following command
~/.go/pkg/tool/linux_amd64/link -o $WORK/b001/exe/a.out -importcfg $WORK/b001/importcfg.link -buildmode=exe -buildid=k8lYa6JYqRdCY9Gyt0jX/16myMybByG5X6rOfaRpS/WHdW2kCTfMCZs2I4x9WE/k8lYa6JYqRdCY9Gyt0jX -extld=g++ ~/.cache/go-build/b5/b5e47b7f77c2df06ba69937dc8b1399b1289b7c90d2e08b3341fdf13e119c860-d