aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorMichal Terepeta <[email protected]>2020-01-06 21:06:01 +0000
committerMichal Terepeta <[email protected]>2020-01-06 21:21:56 +0000
commitbe967b94e15f238a6fe806e93359e302c43d0e45 (patch)
tree6a28cc8aa0172f54b0a0e659b9f45eca7aac7f91 /crates/ra_ide
parent07340a62cc1b34efcebfc9f4cfc42f655edd2fc8 (diff)
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 <[email protected]>
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/change.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_ide/src/change.rs b/crates/ra_ide/src/change.rs
index f92950b71..8b197d642 100644
--- a/crates/ra_ide/src/change.rs
+++ b/crates/ra_ide/src/change.rs
@@ -201,7 +201,7 @@ impl RootDatabase {
201 libraries.push(library.root_id); 201 libraries.push(library.root_id);
202 self.set_source_root_with_durability( 202 self.set_source_root_with_durability(
203 library.root_id, 203 library.root_id,
204 Default::default(), 204 Arc::new(SourceRoot::new_library()),
205 Durability::HIGH, 205 Durability::HIGH,
206 ); 206 );
207 self.set_library_symbols_with_durability( 207 self.set_library_symbols_with_durability(