]> Cypherpunks repositories - gostls13.git/commit
cmd/go: guarantee a minimum of min(4,GOMAXPROCS) to compile -c
authorMichael Matloob <matloob@golang.org>
Mon, 5 Jan 2026 17:23:14 +0000 (12:23 -0500)
committerMichael Matloob <matloob@google.com>
Wed, 7 Jan 2026 20:45:22 +0000 (12:45 -0800)
commit28147b528312055b535c6a69d0d4492bd502e1b0
tree1c239b17317c53b8260bb2e598c871863f22a4d3
parent874d8b98eba8129559b97d2fdfa02ddeb88b95f9
cmd/go: guarantee a minimum of min(4,GOMAXPROCS) to compile -c

To allow this, we also increase the size of the pool to allow the
minimum number for each action, with an extra 2*GOMAXPROCS number of
tokens to boost -c when there are fewer concurrently running actions.
That means the pool will now have the size 6*GOMAXPROCS instead of the
previous 4*GOMAXPROCS.

The goal is to maintain the boosting behavior added by the pool, while
guarding from starving compiles when there are too few tokens left, so
that the value of -c is always at least min(4,GOMAXPROCS), which is what
it was set to before Go 1.26.

Cq-Include-Trybots: luci.golang.try:gotip-linux-arm64_c4as16-perf_vs_parent,gotip-linux-arm64_c4ah72-perf_vs_parent,gotip-linux-amd64_c3h88-perf_vs_parent,gotip-linux-amd64_c2s16-perf_vs_parent
Change-Id: I113a38584514a6c025d3d1bc727ff8d86a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734040
Commit-Queue: Michael Matloob <matloob@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
src/cmd/go/internal/work/gc.go