diff options
author | Aleksey Kladov <[email protected]> | 2020-07-07 09:14:48 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-07 09:14:48 +0100 |
commit | 4bbc385277bcab509c321b1374f72f1ef19d7750 (patch) | |
tree | 74488258fb566dc4344165ade6067d8f2ce7298f /crates/ra_ide/src | |
parent | d4bc2f25de6297c75f7b7f029df224b650ef3143 (diff) |
Switch to fully dynamically dispatched salsa
This improves compile times quite a bit
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r-- | crates/ra_ide/src/status.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/crates/ra_ide/src/status.rs b/crates/ra_ide/src/status.rs index 45411b357..08e6f69cb 100644 --- a/crates/ra_ide/src/status.rs +++ b/crates/ra_ide/src/status.rs | |||
@@ -2,10 +2,7 @@ use std::{fmt, iter::FromIterator, sync::Arc}; | |||
2 | 2 | ||
3 | use hir::MacroFile; | 3 | use hir::MacroFile; |
4 | use ra_db::{ | 4 | use ra_db::{ |
5 | salsa::{ | 5 | salsa::debug::{DebugQueryTable, TableEntry}, |
6 | debug::{DebugQueryTable, TableEntry}, | ||
7 | Database, | ||
8 | }, | ||
9 | FileTextQuery, SourceRootId, | 6 | FileTextQuery, SourceRootId, |
10 | }; | 7 | }; |
11 | use ra_ide_db::{ | 8 | use ra_ide_db::{ |
@@ -14,15 +11,15 @@ use ra_ide_db::{ | |||
14 | }; | 11 | }; |
15 | use ra_prof::{memory_usage, Bytes}; | 12 | use ra_prof::{memory_usage, Bytes}; |
16 | use ra_syntax::{ast, Parse, SyntaxNode}; | 13 | use ra_syntax::{ast, Parse, SyntaxNode}; |
14 | use rustc_hash::FxHashMap; | ||
17 | 15 | ||
18 | use crate::FileId; | 16 | use crate::FileId; |
19 | use rustc_hash::FxHashMap; | ||
20 | 17 | ||
21 | fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { | 18 | fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { |
22 | db.query(ra_db::ParseQuery).entries::<SyntaxTreeStats>() | 19 | ra_db::ParseQuery.in_db(db).entries::<SyntaxTreeStats>() |
23 | } | 20 | } |
24 | fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { | 21 | fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { |
25 | db.query(hir::db::ParseMacroQuery).entries::<SyntaxTreeStats>() | 22 | hir::db::ParseMacroQuery.in_db(db).entries::<SyntaxTreeStats>() |
26 | } | 23 | } |
27 | 24 | ||
28 | // Feature: Status | 25 | // Feature: Status |
@@ -35,10 +32,10 @@ fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { | |||
35 | // | VS Code | **Rust Analyzer: Status** | 32 | // | VS Code | **Rust Analyzer: Status** |
36 | // |=== | 33 | // |=== |
37 | pub(crate) fn status(db: &RootDatabase) -> String { | 34 | pub(crate) fn status(db: &RootDatabase) -> String { |
38 | let files_stats = db.query(FileTextQuery).entries::<FilesStats>(); | 35 | let files_stats = FileTextQuery.in_db(db).entries::<FilesStats>(); |
39 | let syntax_tree_stats = syntax_tree_stats(db); | 36 | let syntax_tree_stats = syntax_tree_stats(db); |
40 | let macro_syntax_tree_stats = macro_syntax_tree_stats(db); | 37 | let macro_syntax_tree_stats = macro_syntax_tree_stats(db); |
41 | let symbols_stats = db.query(LibrarySymbolsQuery).entries::<LibrarySymbolsStats>(); | 38 | let symbols_stats = LibrarySymbolsQuery.in_db(db).entries::<LibrarySymbolsStats>(); |
42 | format!( | 39 | format!( |
43 | "{}\n{}\n{}\n{} (macros)\n\n\nmemory:\n{}\ngc {:?} seconds ago", | 40 | "{}\n{}\n{}\n{} (macros)\n\n\nmemory:\n{}\ngc {:?} seconds ago", |
44 | files_stats, | 41 | files_stats, |