9678f79414
We need VCS status information for each main package we load. If two main packages are under the same VCS repository, we can reuse that information to avoid duplicating work. For instance, the kubernetes holds 51 main packages in its root module, meaning that "go list ./..." repeated the same git calls 51 times. Instead, use a global par.Cache to deduplicate that work. Below are the numbers on kubernetes 5eb584d1cb6917, via "benchcmd -n 8 KubernetesListPackages go list ./...": name old time/op new time/op delta KubernetesListPackages 8.91s ± 0% 3.33s ± 1% -62.61% (p=0.000 n=7+8) name old user-time/op new user-time/op delta KubernetesListPackages 11.2s ± 1% 8.1s ± 2% -27.50% (p=0.000 n=7+8) name old sys-time/op new sys-time/op delta KubernetesListPackages 8.02s ± 0% 1.67s ± 6% -79.21% (p=0.001 n=6+8) name old peak-RSS-bytes new peak-RSS-bytes delta KubernetesListPackages 127MB ± 2% 123MB ± 7% ~ (p=0.328 n=8+8) Fixes #49582. Change-Id: Ib7ef5dc7a35c83a11e209441f5d6f3b8da068259 Reviewed-on: https://go-review.googlesource.com/c/go/+/365394 Trust: Daniel Martí <mvdan@mvdan.cc> Trust: Dominik Honnef <dominik@honnef.co> Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
codereview.cfg | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
LICENSE | ||
PATENTS | ||
README.md | ||
SECURITY.md |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://golang.org/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.