From 88fde7f728612252eef9624a40b3b3f7868309f1 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 17 Oct 2016 02:28:31 +0200 Subject: [PATCH 1/2] Don't process cycles when stalled This improves the `inflate-0.1.0` benchmark by about 10% for me. --- src/librustc_data_structures/obligation_forest/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/librustc_data_structures/obligation_forest/mod.rs b/src/librustc_data_structures/obligation_forest/mod.rs index c079146edbf42..fb2d3291a601b 100644 --- a/src/librustc_data_structures/obligation_forest/mod.rs +++ b/src/librustc_data_structures/obligation_forest/mod.rs @@ -342,6 +342,16 @@ impl ObligationForest { } } + 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); From 0c844d23046161e831a2c265e5b733674cb89655 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 17 Oct 2016 21:53:27 +0200 Subject: [PATCH 2/2] Set stalled=false when encountering an error --- src/librustc_data_structures/obligation_forest/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_data_structures/obligation_forest/mod.rs b/src/librustc_data_structures/obligation_forest/mod.rs index fb2d3291a601b..5e590cb445f79 100644 --- a/src/librustc_data_structures/obligation_forest/mod.rs +++ b/src/librustc_data_structures/obligation_forest/mod.rs @@ -333,6 +333,7 @@ impl ObligationForest { } } Err(err) => { + stalled = false; let backtrace = self.error_at(index); errors.push(Error { error: err,