mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 09:27:27 +00:00
Merge #1523
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:
commit
2e466bb365
2 changed files with 11 additions and 0 deletions
|
@ -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(())
|
||||
|
|
|
@ -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![
|
||||
|
|
Loading…
Reference in a new issue