mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Measure time
This commit is contained in:
parent
02c4f82348
commit
ff75ad13a4
1 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
||||||
//! Name resolution algorithm
|
//! Name resolution algorithm
|
||||||
use std::sync::Arc;
|
use std::{
|
||||||
|
sync::Arc,
|
||||||
|
time::Instant,
|
||||||
|
};
|
||||||
|
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
|
|
||||||
|
@ -74,6 +77,7 @@ pub(crate) fn item_map(
|
||||||
db: &impl DescriptorDatabase,
|
db: &impl DescriptorDatabase,
|
||||||
source_root: SourceRootId,
|
source_root: SourceRootId,
|
||||||
) -> Cancelable<Arc<ItemMap>> {
|
) -> Cancelable<Arc<ItemMap>> {
|
||||||
|
let start = Instant::now();
|
||||||
let module_tree = db._module_tree(source_root)?;
|
let module_tree = db._module_tree(source_root)?;
|
||||||
let input = module_tree
|
let input = module_tree
|
||||||
.modules()
|
.modules()
|
||||||
|
@ -92,6 +96,8 @@ pub(crate) fn item_map(
|
||||||
};
|
};
|
||||||
resolver.resolve()?;
|
resolver.resolve()?;
|
||||||
let res = resolver.result;
|
let res = resolver.result;
|
||||||
|
let elapsed = start.elapsed();
|
||||||
|
log::info!("item_map: {:?}", elapsed);
|
||||||
Ok(Arc::new(res))
|
Ok(Arc::new(res))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue