diff options
author | Kirill Bulatov <[email protected]> | 2020-02-12 11:16:05 +0000 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2020-02-12 15:18:42 +0000 |
commit | 24f7028d3f21b578b424a2b95998c2b9568aea80 (patch) | |
tree | 8d9902d002d9a648dab43aa2bbee6d2d3bd29f38 | |
parent | d5c3808545e26d246d75e0754e81de803f9e53e6 (diff) |
Add profiling
-rw-r--r-- | crates/ra_assists/src/handlers/auto_import.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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::{ | |||
13 | AssocContainerId, AssocItem, Crate, Function, ModPath, Module, ModuleDef, PathResolution, | 13 | AssocContainerId, AssocItem, Crate, Function, ModPath, Module, ModuleDef, PathResolution, |
14 | SourceAnalyzer, Trait, Type, | 14 | SourceAnalyzer, Trait, Type, |
15 | }; | 15 | }; |
16 | use ra_prof::profile; | ||
16 | use rustc_hash::FxHashSet; | 17 | use rustc_hash::FxHashSet; |
17 | use std::collections::BTreeSet; | 18 | use std::collections::BTreeSet; |
18 | 19 | ||
@@ -123,6 +124,7 @@ impl AutoImportAssets { | |||
123 | db: &RootDatabase, | 124 | db: &RootDatabase, |
124 | module_with_name_to_import: Module, | 125 | module_with_name_to_import: Module, |
125 | ) -> BTreeSet<ModPath> { | 126 | ) -> BTreeSet<ModPath> { |
127 | let _p = profile("auto_import::search_for_imports"); | ||
126 | ImportsLocator::new(db) | 128 | ImportsLocator::new(db) |
127 | .find_imports(&self.get_search_query()) | 129 | .find_imports(&self.get_search_query()) |
128 | .into_iter() | 130 | .into_iter() |
@@ -207,6 +209,7 @@ impl AutoImportAssets { | |||
207 | called_function: Function, | 209 | called_function: Function, |
208 | root_crate: Crate, | 210 | root_crate: Crate, |
209 | ) -> FxHashSet<Trait> { | 211 | ) -> FxHashSet<Trait> { |
212 | let _p = profile("auto_import::get_trait_candidates"); | ||
210 | root_crate | 213 | root_crate |
211 | .dependencies(db) | 214 | .dependencies(db) |
212 | .into_iter() | 215 | .into_iter() |