1523: account for dependencies when showing memory usage r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2019-07-12 15:05:28 +00:00
commit 2e466bb365
2 changed files with 11 additions and 0 deletions

View file

@ -115,9 +115,13 @@ pub fn run(verbose: bool, memory_usage: bool, path: &Path, only: Option<&str>) -
println!("Analysis: {:?}, {}", analysis_time.elapsed(), ra_prof::memory_usage());
if memory_usage {
drop(db);
for (name, bytes) in host.per_query_memory_usage() {
println!("{:>8} {}", bytes, name)
}
let before = ra_prof::memory_usage();
drop(host);
println!("leftover: {}", before.allocated - ra_prof::memory_usage().allocated)
}
Ok(())

View file

@ -252,6 +252,13 @@ impl RootDatabase {
let q: $q = Default::default();
let name = format!("{:?}", q);
acc.push((name, before - after));
let before = memory_usage().allocated;
self.query($q).sweep(sweep.discard_everything());
let after = memory_usage().allocated;
let q: $q = Default::default();
let name = format!("{:?} (deps)", q);
acc.push((name, before - after));
)*}
}
sweep_each_query![