Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dependency queue to consider cost for each node #8908

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

JoshMcguigan
Copy link
Contributor

In support of #7437, this updates the dependency queue implementation to consider a non-fixed cost for each node. The behavior of this implementation should match the previous implementation if all units are assigned the same cost by the code which calls the queue method (which is what we do for now).

In the future I can think of at least two ways these costs could be used:

  1. Use some known constant value by default (say 100 as I've done in this PR), and allow the user to provide hints for certain units to influence compilation order (as requested in Provide scheduling hints? #7437).
  2. Take timing data from a previous compilation (perhaps the json output of cargo build -Ztimings=json) and use the actual time required to compile a given unit (in milliseconds) as its cost. Any units not included in the provided timing data could perhaps have their cost set to the median cost of all crates included in the timing data.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 28, 2020
@alexcrichton
Copy link
Member

@bors: r+

Thanks for this! One thing I've wished we could get at some point is an idea of how impactful these scheduling decisions are. I don't know myself how much of an effect they really have on the build, and one of the things I worry about is that they're most impactful for full builds with a cold cache, meaning we may not necessarily have info from `-Ztimings] unfortunately.

@bors
Copy link
Contributor

bors commented Nov 30, 2020

📌 Commit dd5aca3 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 30, 2020
@bors
Copy link
Contributor

bors commented Nov 30, 2020

⌛ Testing commit dd5aca3 with merge 980c163...

@bors
Copy link
Contributor

bors commented Nov 30, 2020

☀️ Test successful - checks-actions
Approved by: alexcrichton
Pushing 980c163 to master...

@bors bors merged commit 980c163 into rust-lang:master Nov 30, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Dec 4, 2020
Update cargo

12 commits in bfca1cd22bf514d5f2b6c1089b0ded0ba7dfaa6e..63d0fe43449adcb316d34d98a982b597faca4178
2020-11-24 16:33:21 +0000 to 2020-12-02 01:44:30 +0000
- Add "--workspace" to update command (rust-lang/cargo#8725)
- Add an FAQ for "Why is my crate rebuilt?" (rust-lang/cargo#8927)
- Set docs.rs as the default extern-map for crates.io (rust-lang/cargo#8877)
- remove extra whitespace when running cargo -Z help (rust-lang/cargo#8924)
- Remove version from dev-dependencies to make it easier to publish. (rust-lang/cargo#8920)
- update dependency queue to consider cost for each node (rust-lang/cargo#8908)
- Fix some rustdoc warnings. (rust-lang/cargo#8911)
- Bump miow dependency to not invalidly assume memory layout (rust-lang/cargo#8909)
- Remove unnecessary trailing semicolons (rust-lang/cargo#8906)
- Fix custom_target_dependency test. (rust-lang/cargo#8907)
- fix: we don't ignore `version` for `git`/`path` deps now (rust-lang/cargo#8900)
- doc (book): add "Getting Started" subsection: "Essential Terminology" (rust-lang/cargo#8855)
@ehuss ehuss added this to the 1.50.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants