]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/work: use par.Cache to cache tool IDs.
authorqmuntal <quimmuntal@gmail.com>
Fri, 28 Feb 2025 19:21:44 +0000 (20:21 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Sat, 1 Mar 2025 08:29:04 +0000 (00:29 -0800)
commitf4750a6cfb8ae84acee56cca1a51c886fa16cc32
treec60e23eb053faa62c1388a5705384ba513e1bc0b
parent039b3ebeba63e22d1db1a4d1926e405b3110c198
cmd/go/internal/work: use par.Cache to cache tool IDs.

The tool IDs can be calculated once and reused across multiple
threads. This is a small optimization that helps optimize system
resources.

On a normal Windows machine with 12 virtual CPUs, the time to build
a hello world program is reduced from over 1 second, with spikes of 2
seconds, to a consistent 0.7 seconds.

Updates #71981.

Change-Id: I85f4a19f8ad4230afa32213780c761b7eb22fa29
Reviewed-on: https://go-review.googlesource.com/c/go/+/653715
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/internal/work/action.go
src/cmd/go/internal/work/buildid.go