dump statistics about re-use w/ -Z time-passes
It's nice to get a rough idea of how much work we're saving.
This commit is contained in:
parent
2e7df80098
commit
903142aee3
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user