aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-07 09:14:48 +0100
committerAleksey Kladov <[email protected]>2020-07-07 09:14:48 +0100
commit4bbc385277bcab509c321b1374f72f1ef19d7750 (patch)
tree74488258fb566dc4344165ade6067d8f2ce7298f /crates/ra_ide/src
parentd4bc2f25de6297c75f7b7f029df224b650ef3143 (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.rs15
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
3use hir::MacroFile; 3use hir::MacroFile;
4use ra_db::{ 4use ra_db::{
5 salsa::{ 5 salsa::debug::{DebugQueryTable, TableEntry},
6 debug::{DebugQueryTable, TableEntry},
7 Database,
8 },
9 FileTextQuery, SourceRootId, 6 FileTextQuery, SourceRootId,
10}; 7};
11use ra_ide_db::{ 8use ra_ide_db::{
@@ -14,15 +11,15 @@ use ra_ide_db::{
14}; 11};
15use ra_prof::{memory_usage, Bytes}; 12use ra_prof::{memory_usage, Bytes};
16use ra_syntax::{ast, Parse, SyntaxNode}; 13use ra_syntax::{ast, Parse, SyntaxNode};
14use rustc_hash::FxHashMap;
17 15
18use crate::FileId; 16use crate::FileId;
19use rustc_hash::FxHashMap;
20 17
21fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { 18fn 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}
24fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { 21fn 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// |===
37pub(crate) fn status(db: &RootDatabase) -> String { 34pub(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,