aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_cli/src/analysis_stats.rs4
-rw-r--r--crates/ra_ide_api/src/change.rs7
2 files changed, 11 insertions, 0 deletions
diff --git a/crates/ra_cli/src/analysis_stats.rs b/crates/ra_cli/src/analysis_stats.rs
index b8ad6aebc..c2a2b66d5 100644
--- a/crates/ra_cli/src/analysis_stats.rs
+++ b/crates/ra_cli/src/analysis_stats.rs
@@ -115,9 +115,13 @@ pub fn run(verbose: bool, memory_usage: bool, path: &Path, only: Option<&str>) -
115 println!("Analysis: {:?}, {}", analysis_time.elapsed(), ra_prof::memory_usage()); 115 println!("Analysis: {:?}, {}", analysis_time.elapsed(), ra_prof::memory_usage());
116 116
117 if memory_usage { 117 if memory_usage {
118 drop(db);
118 for (name, bytes) in host.per_query_memory_usage() { 119 for (name, bytes) in host.per_query_memory_usage() {
119 println!("{:>8} {}", bytes, name) 120 println!("{:>8} {}", bytes, name)
120 } 121 }
122 let before = ra_prof::memory_usage();
123 drop(host);
124 println!("leftover: {}", before.allocated - ra_prof::memory_usage().allocated)
121 } 125 }
122 126
123 Ok(()) 127 Ok(())
diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs
index efc9a92de..179f17ca4 100644
--- a/crates/ra_ide_api/src/change.rs
+++ b/crates/ra_ide_api/src/change.rs
@@ -252,6 +252,13 @@ impl RootDatabase {
252 let q: $q = Default::default(); 252 let q: $q = Default::default();
253 let name = format!("{:?}", q); 253 let name = format!("{:?}", q);
254 acc.push((name, before - after)); 254 acc.push((name, before - after));
255
256 let before = memory_usage().allocated;
257 self.query($q).sweep(sweep.discard_everything());
258 let after = memory_usage().allocated;
259 let q: $q = Default::default();
260 let name = format!("{:?} (deps)", q);
261 acc.push((name, before - after));
255 )*} 262 )*}
256 } 263 }
257 sweep_each_query![ 264 sweep_each_query![