diff --git a/Cargo.lock b/Cargo.lock
index 5a5edc3e27f9..779580762b27 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -996,6 +996,7 @@ dependencies = [
"ra_db 0.1.0",
"ra_fmt 0.1.0",
"ra_hir 0.1.0",
+ "ra_prof 0.1.0",
"ra_syntax 0.1.0",
"ra_text_edit 0.1.0",
"rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/crates/ra_ide_api/Cargo.toml b/crates/ra_ide_api/Cargo.toml
index 45bab4e28b73..333706c1a425 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 a4a086931bc0..5bfdbe7e91ae 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());
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index 41d1f759f5ec..eb8a5354558b 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -12,6 +12,7 @@ use ra_ide_api::{
AssistId,
};
use ra_syntax::{AstNode, SyntaxKind, TextUnit};
+use ra_prof::profile;
use rustc_hash::FxHashMap;
use serde::{Serialize, Deserialize};
use serde_json::to_value;
@@ -328,6 +329,7 @@ pub fn handle_completion(
world: ServerWorld,
params: req::CompletionParams,
) -> Result