mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Fix a problem with Durability
of libraries
When processing a change with added libraries, we used `Default::default` for `SourceRoot` which sets `is_library` to false. Since we use `is_library` to decide whether to use low or high durability, I believe that this caused us to mark many library dependencies as having low durability and thus increased the size of the graph that salsa needed to verify on every change. Based on my initial tests this speeds up the `CrateDefMapQuery` on rust-analyzer from about ~64ms to ~14ms and reduces the number of validations for the query from over 60k to about 7k. Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
This commit is contained in:
parent
07340a62cc
commit
be967b94e1
1 changed files with 1 additions and 1 deletions
|
@ -201,7 +201,7 @@ impl RootDatabase {
|
|||
libraries.push(library.root_id);
|
||||
self.set_source_root_with_durability(
|
||||
library.root_id,
|
||||
Default::default(),
|
||||
Arc::new(SourceRoot::new_library()),
|
||||
Durability::HIGH,
|
||||
);
|
||||
self.set_library_symbols_with_durability(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue