mirror of https://github.com/bobwen-dev/hunter
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.
This commit is contained in:
parent
8c23d058ad
commit
325f5a5ab3
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue