Skip to content

Commit

Permalink
[move-ide] Add debugging info about compilation/analysis times (#19964)
Browse files Browse the repository at this point in the history
## Description 

What the title says (to make it easier to get timing feedback from the
users).
  • Loading branch information
awelc authored Oct 22, 2024
1 parent 5d92377 commit 77304be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion external-crates/move/crates/move-analyzer/src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ use std::{
path::{Path, PathBuf},
sync::{Arc, Condvar, Mutex},
thread,
time::Instant,
};
use tempfile::tempdir;
use url::Url;
Expand Down Expand Up @@ -2085,13 +2086,16 @@ pub fn get_symbols(
lint: LintLevel,
cursor_info: Option<(&PathBuf, Position)>,
) -> Result<(Option<Symbols>, BTreeMap<PathBuf, Vec<Diagnostic>>)> {
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))
Expand Down

0 comments on commit 77304be

Please sign in to comment.