-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: go mod download -json
is a lot slower with go1.13
#34533
Comments
Change https://golang.org/cl/198699 mentions this issue: |
@gopherbot, please backport to Go 1.13.2: this feature caused a significant performance regression for large repositories, and was newly introduced and fairly obscure (so is unlikely to have broad usage at this point). The only likely users are other module proxy implementations; we're asking them explicitly if they care about this field in a |
Backport issue(s) opened: #34679 (for 1.13). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
No objections here or on the email thread, so we're going to go ahead and revert. |
Change https://golang.org/cl/199079 mentions this issue: |
…put of 'go mod download -json'" This reverts CL 183841. Updates #34533 Fixes #34679 Reason for revert: Introduced a significant performance regression for repos with many incompatible-version tags. Change-Id: I75d7fd76e6e1a0902b114b00167b38439e0f8221 Reviewed-on: https://go-review.googlesource.com/c/go/+/198699 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Katie Hockman <katie@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from commit 961837d) Reviewed-on: https://go-review.googlesource.com/c/go/+/199079
Change https://golang.org/cl/204439 mentions this issue: |
codeRepo.Versions previously checked every possible +incompatible version for a 'go.mod' file. That is wasteful and counterproductive. It is wasteful because typically, a project will adopt modules at some major version, after which they will (be required to) use semantic import paths for future major versions. It is counterproductive because it causes an accidental '+incompatible' tag to exist, and no compatible tag can have higher semantic precedence. This change prunes out some of the +incompatible versions in codeRepo.Versions, eliminating the “wasteful” part but not all of the “counterproductive” part: the extraneous versions can still be fetched explicitly, and proxies may include them in the @v/list endpoint. Updates #34165 Updates #34189 Updates #34533 Change-Id: Ifc52c725aa396f7fde2afc727d0d5950acd06946 Reviewed-on: https://go-review.googlesource.com/c/go/+/204439 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>
The feature requested in #32239 was added to go1.13 (per https://golang.org/cl/183841).
That makes the
go mod download -json
command populates the Latest boolean field of the json output by performing an extra query to check thelatest
version of the module.It turned out the overhead of this extra query is significant in some cases,
especially when the module has many incompatible versions tags. E.g. 'k8s.io/kubernetes' or 'github.com/openshift/origin'.
This is a huge regression compared to the benefit from the new functionality.
Let's consider to provide an option to disable, or disable it by default if optimizing the 'latest' query is non trivial.
@bcmills @jayconrod @katiehockman @heschik
The text was updated successfully, but these errors were encountered: