From f44c4b61e131284287b24dea6da6324cbe9cb252 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 7 Jul 2020 12:10:14 +0200 Subject: Add a command to compute memory usage statistics --- crates/ra_ide_db/src/change.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crates/ra_ide_db') 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 { hir::db::BodyQuery.in_db(self).sweep(sweep); } + // Feature: Memory Usage + // + // Clears rust-analyzer's internal database and prints memory usage statistics. + // + // |=== + // | Editor | Action Name + // + // | VS Code | **Rust Analyzer: Memory Usage (Clears Database)** + // |=== pub fn per_query_memory_usage(&mut self) -> Vec<(String, Bytes)> { let mut acc: Vec<(String, Bytes)> = vec![]; let sweep = SweepStrategy::default().discard_values().sweep_all_revisions(); -- cgit v1.2.3