From 7cd6f12926295476d162e21e315ee72671985cd2 Mon Sep 17 00:00:00 2001 From: Michal Terepeta Date: Fri, 3 Jan 2020 13:59:46 +0100 Subject: Split `crate_def_map` into two methods This change: - introduces `compute_crate_def_map` query and renames `CrateDefMap::crate_def_map_query` for consistency, - annotates `crate_def_map` as `salsa::transparent` and adds a top-level `crate_def_map` wrapper function around that starts the profiler and immediately calls into `compute_crate_def_map` query. This allows us to better understand where we spent the time, in particular, how much is spent in the recomputaiton and how much in salsa. Example output (where we don't actually re-compute anything, but the query still takes a non-trivial amount of time): ``` 211ms - handle_inlay_hints 150ms - get_inlay_hints 150ms - SourceAnalyzer::new 65ms - def_with_body_from_child_node 65ms - analyze_container 65ms - analyze_container 65ms - Module::from_definition 65ms - Module::from_file 65ms - crate_def_map 1ms - parse_macro_query (6 calls) 0ms - raw_items_query (1 calls) 64ms - ??? ``` Signed-off-by: Michal Terepeta --- crates/ra_ide/src/change.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/change.rs b/crates/ra_ide/src/change.rs index 387a9cafb..4585bf522 100644 --- a/crates/ra_ide/src/change.rs +++ b/crates/ra_ide/src/change.rs @@ -309,7 +309,7 @@ impl RootDatabase { hir::db::EnumDataQuery hir::db::TraitDataQuery hir::db::RawItemsQuery - hir::db::CrateDefMapQuery + hir::db::ComputeCrateDefMapQuery hir::db::GenericParamsQuery hir::db::FunctionDataQuery hir::db::TypeAliasDataQuery -- cgit v1.2.3