[PATCH] manifest: improve filesnotin performance by using lazymanifest diff

Martin von Zweigbergk martinvonz at google.com
Wed Apr 27 09:20:16 EDT 2016


On Wed, Apr 27, 2016, 01:07 Sean Farley <sean at farley.io> wrote:

>
> Tony Tung <ttung at fb.com> writes:
>
> > # HG changeset patch
> > # User Tony Tung <tonytung at merly.org>
> > # Date 1461740718 25200
> > #      Wed Apr 27 00:05:18 2016 -0700
> > # Branch stable
> > # Node ID 7f80dce78781f5fe691a23f1b7f5a110ed170f32
> > # Parent  97811ff7964710d32cae951df1da8019b46151a2
> > 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.
>
> FYI, we're currently in a feature freeze:
>
> https://www.mercurial-scm.org/wiki/TimeBasedReleasePlan
>
> > diff --git a/mercurial/manifest.py b/mercurial/manifest.py
> > --- a/mercurial/manifest.py
> > +++ b/mercurial/manifest.py
> > @@ -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.items()
>

iteritems() may be noticeably faster on large diffs

> +                    if hashflags[1][0] is None)
>
> (for after May 1st) Would it be feasible to have a perf test for this
> (and some sweet, sweet performance numbers in the commit message)?
>

As usual, I will request real-world perf numbers (instead or in addition).
It would be nice to have them for both a good (small diff) and a bad case
(large diff). Thanks.

_______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160427/590eb2f5/attachment.html>


More information about the Mercurial-devel mailing list