Skip to content
Snippets Groups Projects
  • Bryan C. Mills's avatar
    4b43d668
    internal/testenv: avoid rebuilding all of std in WriteImportcfg · 4b43d668
    Bryan C. Mills authored
    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: default avatarCherry Mui <cherryyz@google.com>
    Reviewed-by: default avatarThan McIntosh <thanm@google.com>
    TryBot-Result: Gopher Robot <gobot@golang.org>
    Auto-Submit: Bryan Mills <bcmills@google.com>
    4b43d668
    History
    internal/testenv: avoid rebuilding all of std in WriteImportcfg
    Bryan C. Mills authored
    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: default avatarCherry Mui <cherryyz@google.com>
    Reviewed-by: default avatarThan McIntosh <thanm@google.com>
    TryBot-Result: Gopher Robot <gobot@golang.org>
    Auto-Submit: Bryan Mills <bcmills@google.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.