Skip to content

cargo -Z minimal-versions update is slow #12514

@d-e-s-o

Description

@d-e-s-o

Problem

cargo -Z minimal-versions update is super slow on some repositories. Take https://github.com/d-e-s-o/cargo-http-registry, for example, where it takes 9 minutes to downgrade dependencies on my system:

$ time cargo -Z minimal-versions update
________________________________________________________
Executed in  543.37 secs    fish           external
   usr time  542.32 secs    0.00 micros  542.32 secs
   sys time    0.10 secs  890.00 micros    0.10 secs

(cargo 1.71.1-nightly, rustc 1.71.1-nightly (eb26296b5 2023-08-03))

I understand it's a somewhat hard problem, but perhaps there is some speedup possible?

I also seem to have identified a regression about two months ago. The above repository uses the command in CI, and in this CI run the command takes a mere 24s to complete (using rust version 1.72.0-nightly (114fb86ca 2023-06-15)). In the next one this time went up to a whooping 10 minutes (!!) (using rust version 1.72.0-nightly (36fb58e43 2023-06-26)). Now it's possible that GitHub Actions also changed something on their side (meaning I cannot guarantee that the environment is exactly the same; there were no large changes to the repository's dependencies from what I can tell, though), but I'd be surprised if that had such an impact.

Steps

  1. git clone https://github.com/d-e-s-o/cargo-http-registry.git
  2. cd cargo-http-registry
  3. cargo -Z minimal-versions update

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.71.1-nightly
release: 1.71.1-nightly
host: x86_64-unknown-linux-gnu
libgit2: 1.6.4 (sys:0.17.1 vendored)
libcurl: 8.1.2 (sys:0.4.61+curl-8.0.1 system ssl:OpenSSL/3.0.9)
os: Gentoo Linux 2.13 [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-dependency-resolutionArea: dependency resolution and the resolverC-bugCategory: bugPerformanceGotta go fast!S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Z-minimal-versionsNightly: minimal-versions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions