diff options
| author | Bryan C. Mills <bcmills@google.com> | 2023-02-02 10:42:46 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-02-02 19:27:33 +0000 |
| commit | 4b43d668c2ae42465af7cbad4bc5fa86d0b6cc15 (patch) | |
| tree | cc68055be7392a361312de837006dc8cbeb56c54 /src/cmd/objdump/objdump_test.go | |
| parent | 18772915a1b9ca211a4bb707de59ee0941b4773b (diff) | |
| download | go-4b43d668c2ae42465af7cbad4bc5fa86d0b6cc15.tar.xz | |
internal/testenv: avoid rebuilding all of std in WriteImportcfg
Instead, have the caller pass in an explicit list of the packages
(if any) they need.
After #47257, a builder running a test does not necessarily have the
entire standard library already cached, especially when running tests
in sharded mode. testenv.WriteImportcfg used to write an importcfg for
the entire standard library — which required rebuilding the entire
standard library — even though most tests need only a tiny subset.
This reduces the time to test internal/abi with a cold build cache on
my workstation from ~16s to ~0.05s.
It somewhat increases the time for 'go test go/internal/gcimporter'
with a cold cache, from ~43s to ~54s, presumably due to decreased
parallelism in rebuilding the standard library and increased overhead
in re-resolving the import map. However, 'go test -short' running time
remains stable (~5.5s before and after).
Fixes #58248.
Change-Id: I9be6b61ae6e28b75b53af85207c281bb93b9346f
Reviewed-on: https://go-review.googlesource.com/c/go/+/464736
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/objdump/objdump_test.go')
| -rw-r--r-- | src/cmd/objdump/objdump_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/objdump/objdump_test.go b/src/cmd/objdump/objdump_test.go index 69b4cf4e21..226e74d81e 100644 --- a/src/cmd/objdump/objdump_test.go +++ b/src/cmd/objdump/objdump_test.go @@ -299,7 +299,7 @@ func TestDisasmGoobj(t *testing.T) { tmp := t.TempDir() importcfgfile := filepath.Join(tmp, "hello.importcfg") - testenv.WriteImportcfg(t, importcfgfile, nil) + testenv.WriteImportcfg(t, importcfgfile, nil, "testdata/fmthello.go") hello := filepath.Join(tmp, "hello.o") args := []string{"tool", "compile", "-p=main", "-importcfg=" + importcfgfile, "-o", hello} |
