Mercurial > public > mercurial-scm > hg-stable
diff mercurial/manifest.py @ 29056:e2178f7d17c0
manifest: improve filesnotin performance by using lazymanifest diff
lazymanifests can compute diffs significantly faster than taking the set
of two manifests and calculating the delta.
when running hg diff --git -c . on Facebook's big repo, this reduces the
run time from 2.1s to 1.5s.
author | Tony Tung <tonytung@merly.org> |
---|---|
date | Mon, 02 May 2016 15:22:16 -0700 |
parents | 1ac8ce137377 |
children | 98e8313dcd9e |
line wrap: on
line diff
--- a/mercurial/manifest.py Tue Apr 19 11:00:15 2016 +0100 +++ b/mercurial/manifest.py Mon May 02 15:22:16 2016 -0700 @@ -211,8 +211,10 @@ def filesnotin(self, m2): '''Set of files in this manifest that are not in the other''' - files = set(self) - files.difference_update(m2) + diff = self.diff(m2) + files = set(filepath + for filepath, hashflags in diff.iteritems() + if hashflags[1][0] is None) return files @propertycache