nabijaczleweli / cargo-update

A cargo subcommand for checking and applying updates to installed executables
MIT License
1.22k stars 42 forks source link

Use the local registry copy instead of asking crates.io #6

Closed dzamlo closed 7 years ago

dzamlo commented 7 years ago

Cargo make a local of the registry (in .cargo/registry). It should be faster to use it instead of asking crates.io for each package.

The local registry should be updated before checking for new versions.

nabijaczleweli commented 7 years ago

Is that easily traversable? I seem to have at least three versions of the registry and (IME) updating it takes way more time than the current approach does.

dzamlo commented 7 years ago

The update to the local registry use git. So the time it takes depends on how old your local version is. I just tested now and doing a cargo search, which update the registry, took ~3s the first time and then ~1s. Doing cargo install-update -la takes ~8s each time, and I think most of it is time spent doing network requests.

For the traversability, I don't know. Looking at the way cargo does it would be a good way to know.

Because I think cargo-update is mainly IO-bounds, another way to speed it up, would be making multiples request in parallel, using threads or async code.

nabijaczleweli commented 7 years ago

Check out the feat/6-use-registry branch for now, will flesh out tomorrow.

nabijaczleweli commented 7 years ago

Very nice, m8

nabijaczleweli commented 7 years ago

Released in v0.4.0.