]> git.lizzy.rs Git - rust.git/commitdiff
Don't process cycles when stalled
authorJonas Schievink <jonasschievink@gmail.com>
Mon, 17 Oct 2016 00:28:31 +0000 (02:28 +0200)
committerJonas Schievink <jonasschievink@gmail.com>
Mon, 17 Oct 2016 00:28:31 +0000 (02:28 +0200)
This improves the `inflate-0.1.0` benchmark by about 10% for me.

src/librustc_data_structures/obligation_forest/mod.rs

index c079146edbf42bbe59989fca939aa519fa374662..fb2d3291a601b8c4d9b7b9bb48ad03780432f53b 100644 (file)
@@ -342,6 +342,16 @@ pub fn process_obligations<P>(&mut self, processor: &mut P) -> Outcome<O, P::Err
             }
         }
 
+        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);