diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2016-08-01 19:56:19 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2016-08-02 05:31:25 -0400 |
| commit | 903142aee32b90ec945f809358eec3849e328e39 (patch) | |
| tree | 0e6341a5c66d3cfb93c1180613fd13d02b83e92a | |
| parent | 2e7df800986cb7eee66cfbb4bd98104c45189d57 (diff) | |
| download | rust-903142aee32b90ec945f809358eec3849e328e39.tar.gz rust-903142aee32b90ec945f809358eec3849e328e39.zip | |
dump statistics about re-use w/ -Z time-passes
It's nice to get a rough idea of how much work we're saving.
| -rw-r--r-- | src/librustc_trans/back/write.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/librustc_trans/back/write.rs b/src/librustc_trans/back/write.rs index 87815c63f79..4b8d6776f22 100644 --- a/src/librustc_trans/back/write.rs +++ b/src/librustc_trans/back/write.rs @@ -724,6 +724,10 @@ pub fn run_passes(sess: &Session, work_items.push(work); } + if sess.time_passes() && sess.opts.incremental.is_some() { + dump_incremental_data(&trans); + } + // Process the work items, optionally using worker threads. // NOTE: This code is not really adapted to incremental compilation where // the compiler decides the number of codegen units (and will @@ -901,6 +905,17 @@ pub fn run_passes(sess: &Session, } } +fn dump_incremental_data(trans: &CrateTranslation) { + let mut reuse = 0; + for mtrans in trans.modules.iter() { + match mtrans.source { + ModuleSource::Preexisting(..) => reuse += 1, + ModuleSource::Translated(..) => (), + } + } + println!("incremental: re-using {} out of {} modules", reuse, trans.modules.len()); +} + struct WorkItem { mtrans: ModuleTranslation, config: ModuleConfig, |
