From fabb32693f712b758f99e544eebfeee6d2aba3df Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 26 Sep 2019 12:31:16 +0300 Subject: disable periodic GC There's hypothesis that it doesn't do anything useful now that we have LRU... --- crates/ra_ide_api/src/change.rs | 6 ------ crates/ra_ide_api/src/status.rs | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs index b4ba3f3cd..981851829 100644 --- a/crates/ra_ide_api/src/change.rs +++ b/crates/ra_ide_api/src/change.rs @@ -13,7 +13,6 @@ use rustc_hash::FxHashMap; use crate::{ db::{DebugData, RootDatabase}, - status::syntax_tree_stats, symbol_index::{SymbolIndex, SymbolsDatabase}, }; @@ -246,11 +245,6 @@ impl RootDatabase { if self.last_gc_check.elapsed() > GC_COOLDOWN { self.last_gc_check = crate::wasm_shims::Instant::now(); - let retained_trees = syntax_tree_stats(self).retained; - if retained_trees > 100 { - log::info!("automatic garbadge collection, {} retained trees", retained_trees); - self.collect_garbage(); - } } } diff --git a/crates/ra_ide_api/src/status.rs b/crates/ra_ide_api/src/status.rs index c037e496d..dee2ea46a 100644 --- a/crates/ra_ide_api/src/status.rs +++ b/crates/ra_ide_api/src/status.rs @@ -17,10 +17,10 @@ use crate::{ FileId, }; -pub(crate) fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { +fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { db.query(ra_db::ParseQuery).entries::() } -pub(crate) fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { +fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { db.query(hir::db::ParseMacroQuery).entries::() } -- cgit v1.2.3