about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-01-13 02:26:37 +0800
committerGitHub <noreply@github.com>2018-01-13 02:26:37 +0800
commit30dbbb528dc315506d1ac28122953356c6d1e2fb (patch)
tree45228234ab528a0152f77ebfa6686f28a4a6813a
parent7ffdabd40164451e25a2588ca09f585fa03f0142 (diff)
parentfe21c4c52221585c507211b4c30570b0f2e93c85 (diff)
downloadrust-30dbbb528dc315506d1ac28122953356c6d1e2fb.tar.gz
rust-30dbbb528dc315506d1ac28122953356c6d1e2fb.zip
Rollup merge of #47331 - michaelwoerister:measure-depgraph-loading, r=alexcrichton
Add -Ztime-passes line for dep-graph loading.

We measure how much time the background thread spends on loading the dep-graph but not how long the main thread is blocked while the background thread is still working. Let's change that!
-rw-r--r--src/librustc_driver/driver.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs
index 8d3b2bc47ec..b7265762208 100644
--- a/src/librustc_driver/driver.rs
+++ b/src/librustc_driver/driver.rs
@@ -889,10 +889,11 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
     let dep_graph = match future_dep_graph {
         None => DepGraph::new_disabled(),
         Some(future) => {
-            let prev_graph = future
-                .open()
-                .expect("Could not join with background dep_graph thread")
-                .open(sess);
+            let prev_graph = time(time_passes, "blocked while dep-graph loading finishes", || {
+                future.open()
+                      .expect("Could not join with background dep_graph thread")
+                      .open(sess)
+            });
             DepGraph::new(prev_graph)
         }
     };