Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: `go mod download -json` is a lot slower with go1.13 #34533
The feature requested in #32239 was added to go1.13 (per https://golang.org/cl/183841).
It turned out the overhead of this extra query is significant in some cases,
This is a huge regression compared to the benefit from the new functionality.
@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
…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 <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Katie Hockman <firstname.lastname@example.org> Reviewed-by: Jay Conrod <email@example.com> (cherry picked from commit 961837d) Reviewed-on: https://go-review.googlesource.com/c/go/+/199079
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 <firstname.lastname@example.org> Reviewed-by: Jay Conrod <email@example.com>