From 4df965a002b5296fc728f1bc2fb9312fe421ea5d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 4 Sep 2018 04:13:22 +0300 Subject: work --- crates/server/src/main_loop/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'crates/server/src/main_loop') diff --git a/crates/server/src/main_loop/mod.rs b/crates/server/src/main_loop/mod.rs index 58f6f88a7..52e3b661d 100644 --- a/crates/server/src/main_loop/mod.rs +++ b/crates/server/src/main_loop/mod.rs @@ -8,7 +8,7 @@ use std::{ use threadpool::ThreadPool; use serde::{Serialize, de::DeserializeOwned}; -use crossbeam_channel::{bounded, Sender, Receiver}; +use crossbeam_channel::{unbounded, Sender, Receiver}; use languageserver_types::{NumberOrString}; use libanalysis::{FileId, JobHandle, JobToken, LibraryData}; use gen_lsp_server::{ @@ -38,7 +38,7 @@ pub fn main_loop( msg_sender: &mut Sender, ) -> Result<()> { let pool = ThreadPool::new(4); - let (task_sender, task_receiver) = bounded::(16); + let (task_sender, task_receiver) = unbounded::(); let (fs_sender, fs_receiver, fs_watcher) = vfs::roots_loader(); let (ws_sender, ws_receiver, ws_watcher) = workspace_loader(); @@ -97,7 +97,7 @@ fn main_loop_inner( pending_requests: &mut HashMap, subs: &mut Subscriptions, ) -> Result<()> { - let (libdata_sender, libdata_receiver) = bounded(1024); + let (libdata_sender, libdata_receiver) = unbounded(); ws_sender.send(ws_root.clone()); fs_sender.send(ws_root.clone()); loop { @@ -137,7 +137,10 @@ fn main_loop_inner( let files = state.events_to_files(events); let sender = libdata_sender.clone(); pool.execute(move || { + let start = ::std::time::Instant::now(); + info!("indexing {} ... ", root.display()); let data = LibraryData::prepare(files); + info!("indexed {:?} {}", start.elapsed(), root.display()); sender.send(data); }); } -- cgit v1.2.3