From 77304be7015e20ddd2442577ecb580a8f4469e2f Mon Sep 17 00:00:00 2001 From: Adam Welc Date: Tue, 22 Oct 2024 11:53:36 -0700 Subject: [PATCH] [move-ide] Add debugging info about compilation/analysis times (#19964) ## Description What the title says (to make it easier to get timing feedback from the users). --- external-crates/move/crates/move-analyzer/src/symbols.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/external-crates/move/crates/move-analyzer/src/symbols.rs b/external-crates/move/crates/move-analyzer/src/symbols.rs index 4bec62fce555b..91cae56626f13 100644 --- a/external-crates/move/crates/move-analyzer/src/symbols.rs +++ b/external-crates/move/crates/move-analyzer/src/symbols.rs @@ -78,6 +78,7 @@ use std::{ path::{Path, PathBuf}, sync::{Arc, Condvar, Mutex}, thread, + time::Instant, }; use tempfile::tempdir; use url::Url; @@ -2085,13 +2086,16 @@ pub fn get_symbols( lint: LintLevel, cursor_info: Option<(&PathBuf, Position)>, ) -> Result<(Option, BTreeMap>)> { + let compilation_start = Instant::now(); let (compiled_pkg_info_opt, ide_diagnostics) = get_compiled_pkg(pkg_dependencies, ide_files_root, pkg_path, lint)?; + eprintln!("compilation complete in: {:?}", compilation_start.elapsed()); let Some(compiled_pkg_info) = compiled_pkg_info_opt else { return Ok((None, ide_diagnostics)); }; + let analysis_start = Instant::now(); let symbols = compute_symbols(compiled_pkg_info, cursor_info); - + eprintln!("analysis complete in {:?}", analysis_start.elapsed()); eprintln!("get_symbols load complete"); Ok((Some(symbols), ide_diagnostics))