From d4b135f38c8c0050768c50e62043ddca5f09079a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 21 Dec 2019 18:45:46 +0100 Subject: Optimize and profile --- crates/ra_hir/src/source_binder.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crates/ra_hir/src/source_binder.rs') diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index b60a6b87e..85b378483 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs @@ -26,6 +26,7 @@ use hir_ty::{ method_resolution::{self, implements_trait}, Canonical, InEnvironment, InferenceResult, TraitEnvironment, Ty, }; +use ra_prof::profile; use ra_syntax::{ ast::{self, AstNode}, match_ast, AstPtr, @@ -83,6 +84,7 @@ fn def_with_body_from_child_node( db: &impl HirDatabase, child: InFile<&SyntaxNode>, ) -> Option { + let _p = profile("def_with_body_from_child_node"); child.cloned().ancestors_with_macros(db).find_map(|node| { let n = &node.value; match_ast! { @@ -169,6 +171,7 @@ impl SourceAnalyzer { node: InFile<&SyntaxNode>, offset: Option, ) -> SourceAnalyzer { + let _p = profile("SourceAnalyzer::new"); let def_with_body = def_with_body_from_child_node(db, node); if let Some(def) = def_with_body { let (_body, source_map) = db.body_with_source_map(def.into()); -- cgit v1.2.3