From c4a5aa45dc480792b24535ee6739a4e9a15e8aa8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 14 Apr 2019 23:28:10 +0300 Subject: add a couple of profiling points --- crates/ra_ide_api/Cargo.toml | 1 + crates/ra_ide_api/src/change.rs | 2 ++ 2 files changed, 3 insertions(+) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/Cargo.toml b/crates/ra_ide_api/Cargo.toml index 45bab4e28..333706c1a 100644 --- a/crates/ra_ide_api/Cargo.toml +++ b/crates/ra_ide_api/Cargo.toml @@ -23,6 +23,7 @@ ra_syntax = { path = "../ra_syntax" } ra_text_edit = { path = "../ra_text_edit" } ra_db = { path = "../ra_db" } ra_fmt = { path = "../ra_fmt" } +ra_prof = { path = "../ra_prof" } hir = { path = "../ra_hir", package = "ra_hir" } test_utils = { path = "../test_utils" } ra_assists = { path = "../ra_assists" } diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs index a4a086931..5bfdbe7e9 100644 --- a/crates/ra_ide_api/src/change.rs +++ b/crates/ra_ide_api/src/change.rs @@ -9,6 +9,7 @@ use ra_db::{ salsa::{Database, SweepStrategy}, }; use ra_syntax::SourceFile; +use ra_prof::profile; use relative_path::RelativePathBuf; use rayon::prelude::*; @@ -153,6 +154,7 @@ const GC_COOLDOWN: time::Duration = time::Duration::from_millis(100); impl RootDatabase { pub(crate) fn apply_change(&mut self, change: AnalysisChange) { + let _p = profile("RootDatabase::apply_change"); log::info!("apply_change {:?}", change); if !change.new_roots.is_empty() { let mut local_roots = Vec::clone(&self.local_roots()); -- cgit v1.2.3