This PR updates the tools/build-all.go utility to achieve significantly shorter overall build times on multi-core processors by using goroutines to allow concurrent builds.
Additionally, it updates the Makefile to send all outputs to the dist directory, keeping the generated files more organized. It also adds a build-dist task, which is now used by the package task to output the compiled binary with a unique name (which was necessary due to the concurrent build processes). The clean task was also updated accordingly.
Benchmarks:
Benchmarks were run on a system with the following specs:
processor model name : 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
number of cpu cores : 8
actual + virtual cores : 16
Benchmark TLDR
Concurrent builds complete in ~3 seconds
Sequential builds complete in ~13 seconds
Benchmark Results
# concurrent builds
go run tools/build-all.go 27.36s user 7.27s system 1138% cpu 3.041 total
# sequential builds
go run tools/build-all.go 20.05s user 5.45s system 196% cpu 12.982 total
Summary
This PR updates the
tools/build-all.go
utility to achieve significantly shorter overall build times on multi-core processors by using goroutines to allow concurrent builds.Additionally, it updates the
Makefile
to send all outputs to thedist
directory, keeping the generated files more organized. It also adds abuild-dist
task, which is now used by thepackage
task to output the compiled binary with a unique name (which was necessary due to the concurrent build processes). Theclean
task was also updated accordingly.Benchmarks:
Benchmarks were run on a system with the following specs:
Benchmark TLDR
Benchmark Results