aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/debug
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2022-12-01 13:39:39 -0500
committerGopher Robot <gobot@golang.org>2022-12-01 22:04:03 +0000
commit6a70292d1cb3464e5b2c2c03341e5148730a1889 (patch)
treed4f3d338b461bdd862b4e1efb81cdf95e46ee58e /src/runtime/debug
parent0e8b6056c99daebcc3c571316a9551c9fab03a00 (diff)
downloadgo-6a70292d1cb3464e5b2c2c03341e5148730a1889.tar.xz
go/internal/gcimporter: load cached export data for packages individually
Previously, we were using internal/goroot.PkgfileMap to locate cached export data. However, PkgfileMap regenerates export data for the entire standard library, whereas gcimporter may only need a single package. Under the new approach, we load the export data (still using 'go list -export') for each GOROOT package individually, avoiding work to rebuild export data for packages that are not needed. This is a tradeoff: if most packages in GOROOT are actually needed, we end up making many more calls to 'go list', and may build packages sequentially instead of in parallel (but with lower latency to start using the export data from the earlier packages). On my workstation, starting from a clean cache for each run, this reduces the wall time of 'go test go/internal/gcimporter -run=TestImportedTypes' from 22s real time (2m10s user time) to 6s real (27s user), and only increases 'go test go/internal/gcimporter' from 28s real (2m16s user) to 30s real (2m19s user). Updates #56967. Updates #47257. Change-Id: I22556acdd9b1acc56533ed4c2728ea29b585c073 Reviewed-on: https://go-review.googlesource.com/c/go/+/454497 Reviewed-by: Michael Matloob <matloob@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/runtime/debug')
0 files changed, 0 insertions, 0 deletions