disable periodic GC
There's hypothesis that it doesn't do anything useful now that we have LRU...
This commit is contained in:
@@ -13,7 +13,6 @@ use rustc_hash::FxHashMap;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
db::{DebugData, RootDatabase},
|
db::{DebugData, RootDatabase},
|
||||||
status::syntax_tree_stats,
|
|
||||||
symbol_index::{SymbolIndex, SymbolsDatabase},
|
symbol_index::{SymbolIndex, SymbolsDatabase},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -246,11 +245,6 @@ impl RootDatabase {
|
|||||||
|
|
||||||
if self.last_gc_check.elapsed() > GC_COOLDOWN {
|
if self.last_gc_check.elapsed() > GC_COOLDOWN {
|
||||||
self.last_gc_check = crate::wasm_shims::Instant::now();
|
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ use crate::{
|
|||||||
FileId,
|
FileId,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub(crate) fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
|
fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
|
||||||
db.query(ra_db::ParseQuery).entries::<SyntaxTreeStats>()
|
db.query(ra_db::ParseQuery).entries::<SyntaxTreeStats>()
|
||||||
}
|
}
|
||||||
pub(crate) fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
|
fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
|
||||||
db.query(hir::db::ParseMacroQuery).entries::<SyntaxTreeStats>()
|
db.query(hir::db::ParseMacroQuery).entries::<SyntaxTreeStats>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user