From 325f5a5ab3f44457263d7d5c04e488faea0d369e Mon Sep 17 00:00:00 2001 From: rabite Date: Wed, 22 Jan 2020 15:28:55 +0100 Subject: [PATCH] remove limit on number of files updated at once Since calculating the hash tables is the costliest part of updating a directory it makes little sense to limit the number of files being processed at once. That only means the hash tables have to be created more often and updates take much more time in total. Since it's all done in an asynchronous worker thread anyway it makes more sense to process as much as possible in one go, even if it takes a second longer. --- src/files.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/files.rs b/src/files.rs index bafffc9..ccdaabf 100644 --- a/src/files.rs +++ b/src/files.rs @@ -547,13 +547,8 @@ impl Files { render_fn: impl Fn(&File) -> String + Send + 'static) -> HResult<()> { let pending = self.pending_events.read()?.len(); - if pending > 0 { - let pending = if pending >= 1000 { - 1000 - } else { - pending - }; + if pending > 0 { let events = self.pending_events .write()? .drain(0..pending)