Build go binaries in parallel
- Dominant language
- Go
- Stars
- 8.5k
- Forks
- 447
- PR merge metrics
- No merged PRs in 30d
Description
Compiling multiple binaries in a single go command is much faster than individually. For example, both incremental builds:
```bash
$ time sh -c '
quote> go build -o /dev/null ./pilot/cmd/pilot-discovery
quote> go build -o /dev/null ./operator/cmd/operator
quote> go build -o /dev/null ./istioctl/cmd/istioctl
quote> '
real 11.060
user 21.847
sys 2.781
$ time go build -o /dev/null ./pilot/cmd/pilot-discovery ./operator/cmd/operator ./istioctl/cmd/istioctl
real 5.031
user 20.895
sys 1.469
```
Along with https://github.com/google/ko/issues/236, this would improve the speed of `ko` quite a bit I think.
Currently building these 3 binaries in parallel then building and pushing in parallel with `docker buildx bake`, warm builds take ~8s compared to ~23s for `ko`
Contributor guide
Research direction
Start by tracing ko's build path and how it invokes the Go commands for ./pilot/cmd/pilot-discovery, ./operator/cmd/operator, and ./istioctl/cmd/istioctl. Compare that path with the single multi-package go build shown in the issue, then verify that warm builds improve while the existing docker buildx bake and push flow still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- build-system, performance
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100