Improve Cargo's scheduling of builds
authorAlex Crichton <alex@alexcrichton.com>
Thu, 1 Mar 2018 06:04:54 +0000 (22:04 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 1 Mar 2018 21:31:57 +0000 (13:31 -0800)
commite54b5f875d0f2127a5daf8402557d058c9a3e652
treebef03bebc0b45a540e8120897f5e878ac5280798
parentf55b326e1f813c682dab710a03ebc3b91e7483fa
Improve Cargo's scheduling of builds

Historically Cargo has been pretty naive about scheduling builds, basically just
greedily scheduling as much work as possible. As pointed out in #5014, however,
this isn't guaranteed to always have the best results. If we've got a very deep
dependency tree that would otherwise fill up our CPUs Cargo should ideally
schedule these dependencies first. That way when we reach higher up in the
dependency tree we should have more work available to fill in the cracks if
there's spare cpus.

Closes #5014
src/cargo/ops/cargo_rustc/job_queue.rs
src/cargo/util/dependency_queue.rs