diff options
author | Aleksey Kladov <[email protected]> | 2019-05-29 12:34:21 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-05-29 12:34:21 +0100 |
commit | 6a1e3e59cb06b8372be00f9f4277e20d06c9050a (patch) | |
tree | 193d984ba8935d7093a2243093c9ea102d5d880e /crates/ra_lsp_server | |
parent | 9eef546ca2f59d0ebc0e5dc443fc1a5d93926030 (diff) |
more perf logging
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop.rs | 11 |
1 files changed, 8 insertions, 3 deletions
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( | |||
170 | 170 | ||
171 | let (libdata_sender, libdata_receiver) = unbounded(); | 171 | let (libdata_sender, libdata_receiver) = unbounded(); |
172 | loop { | 172 | loop { |
173 | let _p = profile("loop_turn"); | ||
173 | state.maybe_collect_garbage(); | 174 | state.maybe_collect_garbage(); |
175 | |||
174 | log::trace!("selecting"); | 176 | log::trace!("selecting"); |
175 | let event = select! { | 177 | let event = select! { |
176 | recv(msg_receiver) -> msg => match msg { | 178 | recv(msg_receiver) -> msg => match msg { |
@@ -184,8 +186,11 @@ fn main_loop_inner( | |||
184 | }, | 186 | }, |
185 | recv(libdata_receiver) -> data => Event::Lib(data.unwrap()) | 187 | recv(libdata_receiver) -> data => Event::Lib(data.unwrap()) |
186 | }; | 188 | }; |
187 | log::info!("loop_turn = {:?}", event); | 189 | log::info!("loop turn = {:?}", event); |
188 | let _p = profile("loop_turn"); | 190 | let queue_count = pool.queued_count(); |
191 | if queue_count > 0 { | ||
192 | log::info!("queued count = {}", queue_count); | ||
193 | } | ||
189 | let mut state_changed = false; | 194 | let mut state_changed = false; |
190 | match event { | 195 | match event { |
191 | Event::Task(task) => on_task(task, msg_sender, pending_requests), | 196 | Event::Task(task) => on_task(task, msg_sender, pending_requests), |
@@ -468,7 +473,7 @@ impl<'a> PoolDispatcher<'a> { | |||
468 | Ok(self) | 473 | Ok(self) |
469 | } | 474 | } |
470 | 475 | ||
471 | fn finish(&mut self) -> ::std::result::Result<u64, RawRequest> { | 476 | fn finish(&mut self) -> std::result::Result<u64, RawRequest> { |
472 | match (self.res.take(), self.req.take()) { | 477 | match (self.res.take(), self.req.take()) { |
473 | (Some(res), None) => Ok(res), | 478 | (Some(res), None) => Ok(res), |
474 | (None, Some(req)) => Err(req), | 479 | (None, Some(req)) => Err(req), |