From 6a1e3e59cb06b8372be00f9f4277e20d06c9050a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 29 May 2019 14:34:21 +0300 Subject: more perf logging --- crates/ra_lsp_server/src/main_loop.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'crates/ra_lsp_server/src') diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 87b4e3ac2..16c05e4c3 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -170,7 +170,9 @@ fn main_loop_inner( let (libdata_sender, libdata_receiver) = unbounded(); loop { + let _p = profile("loop_turn"); state.maybe_collect_garbage(); + log::trace!("selecting"); let event = select! { recv(msg_receiver) -> msg => match msg { @@ -184,8 +186,11 @@ fn main_loop_inner( }, recv(libdata_receiver) -> data => Event::Lib(data.unwrap()) }; - log::info!("loop_turn = {:?}", event); - let _p = profile("loop_turn"); + log::info!("loop turn = {:?}", event); + let queue_count = pool.queued_count(); + if queue_count > 0 { + log::info!("queued count = {}", queue_count); + } let mut state_changed = false; match event { Event::Task(task) => on_task(task, msg_sender, pending_requests), @@ -468,7 +473,7 @@ impl<'a> PoolDispatcher<'a> { Ok(self) } - fn finish(&mut self) -> ::std::result::Result { + fn finish(&mut self) -> std::result::Result { match (self.res.take(), self.req.take()) { (Some(res), None) => Ok(res), (None, Some(req)) => Err(req), -- cgit v1.2.3