From 88fde7f728612252eef9624a40b3b3f7868309f1 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 17 Oct 2016 02:28:31 +0200 Subject: [PATCH] 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 c079146edbf4..fb2d3291a601 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);