Skip to content

Make process_obligations() greedier. #66408

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

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

nnethercote
Copy link
Contributor

process_obligations() adds new nodes, but it does not process these
new nodes until the next time it is called.

This commit changes it so that it does process these new nodes within
the same call. This change reduces the number of calls to
process_obligations() required to complete processing, sometimes
giving significant speed-ups.

The change required some changes to tests.

  • The output of cycle-cache-err-60010.rs is slightly different.
  • The unit tests required extra cases to handle the earlier processing
    of the added nodes. I mostly did these in the simplest possible way,
    by making the added nodes be ignored, thus giving outcomes the same as
    with the old behaviour. But I changed success_in_grandchildren()
    more extensively so that some obligations are completed earlier than
    they used to be.

r? @nikomatsakis

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 14, 2019
@nnethercote
Copy link
Contributor Author

@nikomatakis: I'm not 100% confident about the cycle-cache-err-60010.rs output changes, but I'm guessing/hoping that the new output is similar enough that it's equivalent.

Some local instruction count measurements:

keccak-check
        avg: -4.9%      min: -7.5%      max: -0.0%
inflate-check
        avg: -2.6%      min: -3.6%      max: -0.0%
cranelift-codegen-check
        avg: -1.2%      min: -2.0%      max: 0.0%
wg-grammar-check
        avg: -1.2%      min: -1.8%      max: -0.1%
clap-rs-check
        avg: -0.7%      min: -1.7%      max: 0.0%
unify-linearly-check
        avg: -0.4%      min: -0.7%      max: -0.1%
deeply-nested-check
        avg: -0.4%      min: -0.7%      max: -0.1%
regression-31157-check
        avg: -0.2%      min: -0.5%      max: -0.0%
style-servo-check
        avg: -0.2%      min: -0.4%      max: -0.0%

@nnethercote
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Collaborator

bors commented Nov 14, 2019

⌛ Trying commit 98a7454 with merge f988482...

bors added a commit that referenced this pull request Nov 14, 2019
Make `process_obligations()` greedier.

`process_obligations()` adds new nodes, but it does not process these
new nodes until the next time it is called.

This commit changes it so that it does process these new nodes within
the same call. This change reduces the number of calls to
`process_obligations()` required to complete processing, sometimes
giving significant speed-ups.

The change required some changes to tests.
- The output of `cycle-cache-err-60010.rs` is slightly different.
- The unit tests required extra cases to handle the earlier processing
  of the added nodes. I mostly did these in the simplest possible way,
  by making the added nodes be ignored, thus giving outcomes the same as
  with the old behaviour. But I changed `success_in_grandchildren()`
  more extensively so that some obligations are completed earlier than
  they used to be.

r? @nikomatsakis
@bors
Copy link
Collaborator

bors commented Nov 14, 2019

☀️ Try build successful - checks-azure
Build commit: f988482 (f988482f08119a7de8f3a4a18c101dd23b5eba1a)

@rust-timer
Copy link
Collaborator

Queued f988482 with parent 5e380b7, future comparison URL.

@nnethercote
Copy link
Contributor Author

The perf improvements on CI are similar to what I saw locally.

`process_obligations()` adds new nodes, but it does not process these
new nodes until the next time it is called.

This commit changes it so that it does process these new nodes within
the same call. This change reduces the number of calls to
`process_obligations()` required to complete processing, sometimes
giving significant speed-ups.

The change required some changes to tests.
- The output of `cycle-cache-err-60010.rs` is slightly different.
- The unit tests required extra cases to handle the earlier processing
  of the added nodes. I mostly did these in the simplest possible way,
  by making the added nodes be ignored, thus giving outcomes the same as
  with the old behaviour. But I changed `success_in_grandchildren()`
  more extensively so that some obligations are completed earlier than
  they used to be.
@nnethercote nnethercote force-pushed the greedy-process_obligations branch from 98a7454 to 05f13a8 Compare November 14, 2019 21:33
@JohnCSimon
Copy link
Member

Ping from triage
@nikomatsakis - can you please review this PR?
Thank you!

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me modulo nit below -- @nnethercote if you hate it you can also ignore, but it seems like a slight improvement to me

@nnethercote
Copy link
Contributor Author

@bors r=nmatsakis

@bors
Copy link
Collaborator

bors commented Dec 3, 2019

📌 Commit 05f13a8 has been approved by nmatsakis

@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 Dec 3, 2019
@Centril
Copy link
Contributor

Centril commented Dec 3, 2019

@bors rollup=never

@bors
Copy link
Collaborator

bors commented Dec 3, 2019

⌛ Testing commit 05f13a8 with merge 0ecfb9332bac36049d7e9a3acfc41df2deadc5dd...

@Centril
Copy link
Contributor

Centril commented Dec 3, 2019

@bors retry yielding to r0llup

@bors
Copy link
Collaborator

bors commented Dec 4, 2019

⌛ Testing commit 05f13a8 with merge c4f1304...

bors added a commit that referenced this pull request Dec 4, 2019
…sakis

Make `process_obligations()` greedier.

`process_obligations()` adds new nodes, but it does not process these
new nodes until the next time it is called.

This commit changes it so that it does process these new nodes within
the same call. This change reduces the number of calls to
`process_obligations()` required to complete processing, sometimes
giving significant speed-ups.

The change required some changes to tests.
- The output of `cycle-cache-err-60010.rs` is slightly different.
- The unit tests required extra cases to handle the earlier processing
  of the added nodes. I mostly did these in the simplest possible way,
  by making the added nodes be ignored, thus giving outcomes the same as
  with the old behaviour. But I changed `success_in_grandchildren()`
  more extensively so that some obligations are completed earlier than
  they used to be.

r? @nikomatsakis
@bors
Copy link
Collaborator

bors commented Dec 4, 2019

☀️ Test successful - checks-azure
Approved by: nmatsakis
Pushing c4f1304 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 4, 2019
@bors bors merged commit 05f13a8 into rust-lang:master Dec 4, 2019
@nnethercote nnethercote deleted the greedy-process_obligations branch December 5, 2019 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

8 participants