Skip to content

Commit

Permalink
Rollup merge of rust-lang#37231 - jonas-schievink:obligation-forest-t…
Browse files Browse the repository at this point in the history
…he-quest-for-performance, r=arielb1

[Obligation Forest] Don't process cycles when stalled

This improves the `inflate-0.1.0` benchmark by about 10% for me.

/me hopes this is sound
  • Loading branch information
eddyb authored Oct 19, 2016
2 parents 7b0eb10 + 0c844d2 commit 6ae80c6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/librustc_data_structures/obligation_forest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ impl<O: ForestObligation> ObligationForest<O> {
}
}
Err(err) => {
stalled = false;
let backtrace = self.error_at(index);
errors.push(Error {
error: err,
Expand All @@ -342,6 +343,16 @@ impl<O: ForestObligation> ObligationForest<O> {
}
}

if stalled {
// There's no need to perform marking, cycle processing and compression when nothing
// changed.
return Outcome {
completed: vec![],
errors: errors,
stalled: stalled,
};
}

self.mark_as_waiting();
self.process_cycles(processor);

Expand Down

0 comments on commit 6ae80c6

Please sign in to comment.