Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4d9d15c

Browse files
authoredOct 19, 2016
Rollup merge of rust-lang#37231 - jonas-schievink:obligation-forest-the-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
2 parents 58b64e7 + 0c844d2 commit 4d9d15c

File tree

1 file changed

+11
-0
lines changed
  • src/librustc_data_structures/obligation_forest

1 file changed

+11
-0
lines changed
 

‎src/librustc_data_structures/obligation_forest/mod.rs

+11
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ impl<O: ForestObligation> ObligationForest<O> {
333333
}
334334
}
335335
Err(err) => {
336+
stalled = false;
336337
let backtrace = self.error_at(index);
337338
errors.push(Error {
338339
error: err,
@@ -342,6 +343,16 @@ impl<O: ForestObligation> ObligationForest<O> {
342343
}
343344
}
344345

346+
if stalled {
347+
// There's no need to perform marking, cycle processing and compression when nothing
348+
// changed.
349+
return Outcome {
350+
completed: vec![],
351+
errors: errors,
352+
stalled: stalled,
353+
};
354+
}
355+
345356
self.mark_as_waiting();
346357
self.process_cycles(processor);
347358

0 commit comments

Comments
 (0)
Please sign in to comment.