-
- Downloads
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>
Showing
- src/cmd/internal/archive/archive_test.go 1 addition, 1 deletionsrc/cmd/internal/archive/archive_test.go
- src/cmd/link/link_test.go 11 additions, 11 deletionssrc/cmd/link/link_test.go
- src/cmd/objdump/objdump_test.go 1 addition, 1 deletionsrc/cmd/objdump/objdump_test.go
- src/cmd/pack/pack_test.go 2 additions, 2 deletionssrc/cmd/pack/pack_test.go
- src/go/internal/gcimporter/gcimporter_test.go 7 additions, 33 deletionssrc/go/internal/gcimporter/gcimporter_test.go
- src/internal/abi/abi_test.go 4 additions, 4 deletionssrc/internal/abi/abi_test.go
- src/internal/goroot/importcfg.go 0 additions, 66 deletionssrc/internal/goroot/importcfg.go
- src/internal/testenv/testenv.go 39 additions, 12 deletionssrc/internal/testenv/testenv.go
Loading
Please register or sign in to comment