]> git.proxmox.com Git - cargo.git/commit
Parallelize downloads with HTTP/2
authorAlex Crichton <alex@alexcrichton.com>
Tue, 11 Sep 2018 00:28:18 +0000 (17:28 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 18 Sep 2018 18:33:04 +0000 (11:33 -0700)
commit468f243e0ece85397250684a3fe885d9c44cad24
treed248d082f044e7932bb110f9b6e651e55ecfdf48
parent44a7ee7db8621c33b4ff519be98343f95dbc5ba6
Parallelize downloads with HTTP/2

This commit implements parallel downloads using `libcurl` powered by
`libnghttp2` over HTTP/2. Using all of the previous refactorings this actually
implements usage of `Multi` to download crates in parallel. This achieves some
large wins locally, taking download times from 30s to 2s in the best case.

The standard output of Cargo is also changed as a result of this commit. It's
no longer useful for Cargo to print "Downloading ..." for each crate really as
they all start instantaneously. Instead Cargo now no longer prints `Downloading`
by default (unless attached to a pipe) and instead only has one progress bar for
all downloads. Currently this progress bar is discrete and based on the total
number of downloads, no longer specifying how much of one particular download
has happened. This provides a less granular view into what Cargo is doing but
it's hoped that it looks reasonable from an outside perspective as there's
still a progress bar indicating what's happening.
Cargo.toml
src/cargo/core/compiler/context/unit_dependencies.rs
src/cargo/core/package.rs
src/cargo/core/registry.rs
src/cargo/ops/cargo_install.rs
src/cargo/ops/resolve.rs
src/cargo/util/network.rs
src/cargo/util/progress.rs