diff --git a/CHANGELOG.md b/CHANGELOG.md index dc65a3e3c2..0cf2bd148e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Fixed - do not allow to ignore .gitignore files ([#825](https://github.com/extrawurst/gitui/issues/825)) - crash in shallow repo ([#836](https://github.com/extrawurst/gitui/issues/836)) +- fixed performance regression in revlog ([#850](https://github.com/extrawurst/gitui/issues/850)) ## [0.16.2] - 2021-07-10 diff --git a/asyncgit/src/tags.rs b/asyncgit/src/tags.rs index 1cc40e9b3b..6581e40fd2 100644 --- a/asyncgit/src/tags.rs +++ b/asyncgit/src/tags.rs @@ -66,7 +66,13 @@ impl AsyncTags { ) -> Result<()> { log::trace!("request"); - if !force && (self.is_pending() || !self.is_outdated(dur)?) { + if !force && self.is_pending() { + return Ok(()); + } + + let outdated = self.is_outdated(dur)?; + + if !force && !outdated { return Ok(()); } @@ -77,8 +83,8 @@ impl AsyncTags { self.pending.fetch_add(1, Ordering::Relaxed); rayon_core::spawn(move || { - let notify = - Self::getter(&arc_last).expect("error getting tags"); + let notify = Self::getter(&arc_last, outdated) + .expect("error getting tags"); arc_pending.fetch_sub(1, Ordering::Relaxed); @@ -96,14 +102,16 @@ impl AsyncTags { fn getter( arc_last: &Arc>>, + outdated: bool, ) -> Result { let tags = sync::get_tags(CWD)?; let hash = hash(&tags); - if Self::last_hash(arc_last) - .map(|last| last == hash) - .unwrap_or_default() + if !outdated + && Self::last_hash(arc_last) + .map(|last| last == hash) + .unwrap_or_default() { return Ok(false); }