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>