From ff75ad13a45dc603d445b1491d65e17c4db9addb Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 21 Nov 2018 11:18:43 +0300 Subject: Measure time --- crates/ra_analysis/src/descriptors/module/nameres.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'crates/ra_analysis/src/descriptors/module') diff --git a/crates/ra_analysis/src/descriptors/module/nameres.rs b/crates/ra_analysis/src/descriptors/module/nameres.rs index 2fae93c9d..a354fa54c 100644 --- a/crates/ra_analysis/src/descriptors/module/nameres.rs +++ b/crates/ra_analysis/src/descriptors/module/nameres.rs @@ -1,5 +1,8 @@ //! Name resolution algorithm -use std::sync::Arc; +use std::{ + sync::Arc, + time::Instant, +}; use rustc_hash::FxHashMap; @@ -74,6 +77,7 @@ pub(crate) fn item_map( db: &impl DescriptorDatabase, source_root: SourceRootId, ) -> Cancelable> { + let start = Instant::now(); let module_tree = db._module_tree(source_root)?; let input = module_tree .modules() @@ -92,6 +96,8 @@ pub(crate) fn item_map( }; resolver.resolve()?; let res = resolver.result; + let elapsed = start.elapsed(); + log::info!("item_map: {:?}", elapsed); Ok(Arc::new(res)) } -- cgit v1.2.3