diff options
author | Jonas Schievink <[email protected]> | 2020-07-07 11:10:14 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-07-07 11:10:14 +0100 |
commit | f44c4b61e131284287b24dea6da6324cbe9cb252 (patch) | |
tree | d05b6d48374da0097d359b16115da959b57048ce /crates/ra_ide_db | |
parent | 0f5d62a3f3b33edadea50ea93c725ac36460c0d7 (diff) |
Add a command to compute memory usage statistics
Diffstat (limited to 'crates/ra_ide_db')
-rw-r--r-- | crates/ra_ide_db/src/change.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_ide_db/src/change.rs b/crates/ra_ide_db/src/change.rs index d8da3f949..84c6f40ff 100644 --- a/crates/ra_ide_db/src/change.rs +++ b/crates/ra_ide_db/src/change.rs | |||
@@ -164,6 +164,15 @@ impl RootDatabase { | |||
164 | hir::db::BodyQuery.in_db(self).sweep(sweep); | 164 | hir::db::BodyQuery.in_db(self).sweep(sweep); |
165 | } | 165 | } |
166 | 166 | ||
167 | // Feature: Memory Usage | ||
168 | // | ||
169 | // Clears rust-analyzer's internal database and prints memory usage statistics. | ||
170 | // | ||
171 | // |=== | ||
172 | // | Editor | Action Name | ||
173 | // | ||
174 | // | VS Code | **Rust Analyzer: Memory Usage (Clears Database)** | ||
175 | // |=== | ||
167 | pub fn per_query_memory_usage(&mut self) -> Vec<(String, Bytes)> { | 176 | pub fn per_query_memory_usage(&mut self) -> Vec<(String, Bytes)> { |
168 | let mut acc: Vec<(String, Bytes)> = vec![]; | 177 | let mut acc: Vec<(String, Bytes)> = vec![]; |
169 | let sweep = SweepStrategy::default().discard_values().sweep_all_revisions(); | 178 | let sweep = SweepStrategy::default().discard_values().sweep_all_revisions(); |