Auto merge of #17639 - Veykril:salsa-perf, r=Veykril

Some more small salsa memory improvements

This does limit our lru limits to 2^16 but if you want to set them higher than that you might as well not set them at all. Also makes `LRU` opt-in per query now, allowing us to drop all the unnecessary LRU stuff for most queries
This commit is contained in:
bors 2024-07-19 18:45:16 +00:00
commit b333f85a9d
18 changed files with 1240 additions and 402 deletions

View file

@ -377,7 +377,7 @@ fn load_crate_graph(
) -> RootDatabase {
let ProjectWorkspace { toolchain, target_layout, .. } = ws;
let lru_cap = std::env::var("RA_LRU_CAP").ok().and_then(|it| it.parse::<usize>().ok());
let lru_cap = std::env::var("RA_LRU_CAP").ok().and_then(|it| it.parse::<u16>().ok());
let mut db = RootDatabase::new(lru_cap);
let mut analysis_change = ChangeWithProcMacros::new();