aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-21 08:18:43 +0000
committerAleksey Kladov <[email protected]>2018-11-21 08:18:43 +0000
commitff75ad13a45dc603d445b1491d65e17c4db9addb (patch)
tree8415f7c46f21803ecdaf3109811dcc94e6d080d3 /crates
parent02c4f823485fb5302b8f8eb6fee84122ca73979c (diff)
Measure time
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_analysis/src/descriptors/module/nameres.rs8
1 files changed, 7 insertions, 1 deletions
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 @@
1//! Name resolution algorithm 1//! Name resolution algorithm
2use std::sync::Arc; 2use std::{
3 sync::Arc,
4 time::Instant,
5};
3 6
4use rustc_hash::FxHashMap; 7use rustc_hash::FxHashMap;
5 8
@@ -74,6 +77,7 @@ pub(crate) fn item_map(
74 db: &impl DescriptorDatabase, 77 db: &impl DescriptorDatabase,
75 source_root: SourceRootId, 78 source_root: SourceRootId,
76) -> Cancelable<Arc<ItemMap>> { 79) -> Cancelable<Arc<ItemMap>> {
80 let start = Instant::now();
77 let module_tree = db._module_tree(source_root)?; 81 let module_tree = db._module_tree(source_root)?;
78 let input = module_tree 82 let input = module_tree
79 .modules() 83 .modules()
@@ -92,6 +96,8 @@ pub(crate) fn item_map(
92 }; 96 };
93 resolver.resolve()?; 97 resolver.resolve()?;
94 let res = resolver.result; 98 let res = resolver.result;
99 let elapsed = start.elapsed();
100 log::info!("item_map: {:?}", elapsed);
95 Ok(Arc::new(res)) 101 Ok(Arc::new(res))
96} 102}
97 103