Add profiling
This commit is contained in:
parent
d5c3808545
commit
24f7028d3f
1 changed files with 3 additions and 0 deletions
|
@ -13,6 +13,7 @@ use hir::{
|
||||||
AssocContainerId, AssocItem, Crate, Function, ModPath, Module, ModuleDef, PathResolution,
|
AssocContainerId, AssocItem, Crate, Function, ModPath, Module, ModuleDef, PathResolution,
|
||||||
SourceAnalyzer, Trait, Type,
|
SourceAnalyzer, Trait, Type,
|
||||||
};
|
};
|
||||||
|
use ra_prof::profile;
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
use std::collections::BTreeSet;
|
use std::collections::BTreeSet;
|
||||||
|
|
||||||
|
@ -123,6 +124,7 @@ impl AutoImportAssets {
|
||||||
db: &RootDatabase,
|
db: &RootDatabase,
|
||||||
module_with_name_to_import: Module,
|
module_with_name_to_import: Module,
|
||||||
) -> BTreeSet<ModPath> {
|
) -> BTreeSet<ModPath> {
|
||||||
|
let _p = profile("auto_import::search_for_imports");
|
||||||
ImportsLocator::new(db)
|
ImportsLocator::new(db)
|
||||||
.find_imports(&self.get_search_query())
|
.find_imports(&self.get_search_query())
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -207,6 +209,7 @@ impl AutoImportAssets {
|
||||||
called_function: Function,
|
called_function: Function,
|
||||||
root_crate: Crate,
|
root_crate: Crate,
|
||||||
) -> FxHashSet<Trait> {
|
) -> FxHashSet<Trait> {
|
||||||
|
let _p = profile("auto_import::get_trait_candidates");
|
||||||
root_crate
|
root_crate
|
||||||
.dependencies(db)
|
.dependencies(db)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
Loading…
Add table
Reference in a new issue