From 24f7028d3f21b578b424a2b95998c2b9568aea80 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 12 Feb 2020 13:16:05 +0200 Subject: Add profiling --- crates/ra_assists/src/handlers/auto_import.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ra_assists/src/handlers/auto_import.rs b/crates/ra_assists/src/handlers/auto_import.rs index 9a366414c..2dcea3766 100644 --- a/crates/ra_assists/src/handlers/auto_import.rs +++ b/crates/ra_assists/src/handlers/auto_import.rs @@ -13,6 +13,7 @@ use hir::{ AssocContainerId, AssocItem, Crate, Function, ModPath, Module, ModuleDef, PathResolution, SourceAnalyzer, Trait, Type, }; +use ra_prof::profile; use rustc_hash::FxHashSet; use std::collections::BTreeSet; @@ -123,6 +124,7 @@ impl AutoImportAssets { db: &RootDatabase, module_with_name_to_import: Module, ) -> BTreeSet { + let _p = profile("auto_import::search_for_imports"); ImportsLocator::new(db) .find_imports(&self.get_search_query()) .into_iter() @@ -207,6 +209,7 @@ impl AutoImportAssets { called_function: Function, root_crate: Crate, ) -> FxHashSet { + let _p = profile("auto_import::get_trait_candidates"); root_crate .dependencies(db) .into_iter() -- cgit v1.2.3