[PATCH] manifest: avoid intersectfiles for matches > 100 files

Martin von Zweigbergk martinvonz at google.com
Thu Mar 19 09:59:42 CDT 2015


On Thu, Mar 19, 2015 at 7:54 AM Durham Goode <durham at fb.com> wrote:

>  Hg histedit a few commits and change the last pick to mess.  As long as
> the last commit doesn't add any new files it will trigger the issue (since
> the issue only happens when all files being matched exist in the manifest
> already).
>
I agree with the fix, but if I understood correctly from our discussion on
IRC yesterday, the description is not accurate. Wasn't the problem rather
that the part after the "or" evaluates "util.all(fn in self for fn in
files)", which is almost the same thing as intersectfiles() and it's called
only to determine whether to call intersectfiles(). But if that's the case,
I guess I don't understand why the overall condition does not evaluate to
True (before your patch). Is it that all the files are not in the changeset
(self)?



> On Mar 19, 2015 6:24 AM, Augie Fackler <raf at durin42.com> wrote:
>
>  On Wed, Mar 18, 2015 at 04:07:26PM -0700, Durham Goode wrote:
> > # HG changeset patch
> > # User Durham Goode <durham at fb.com>
> > # Date 1426719585 25200
> > #      Wed Mar 18 15:59:45 2015 -0700
> > # Node ID c22eaf00a52f752fc8a776b822549de9f71495a9
> > # Parent  cdc4f3af2497b7342a8e4a081d2b07c9d888235a
> > manifest: avoid intersectfiles for matches > 100 files
> >
> > Previously we only avoid manifest.intersectfiles for exact matches with
> less
> > than 100 files. We did not avoid it for non-exact matches. Let's just
> avoid
> > intersectfiles for all matches of > 100 files since the performance can
> be quite
> > rough with the new lazy manifest.
>
> Seems reasonable. Do you have a particular command that I can mention
> in the commit message when I queue it? I'd like to document things
> like this so that we can start thinking about performance more
> systematically soon.
>
> >
> > diff --git a/mercurial/manifest.py b/mercurial/manifest.py
> > --- a/mercurial/manifest.py
> > +++ b/mercurial/manifest.py
> > @@ -164,8 +164,8 @@ class manifestdict(object):
> >              return self.copy()
> >
> >          files = match.files()
> > -        if ((match.matchfn == match.exact and len(files) < 100) or
> > -            (not match.anypats() and util.all(fn in self for fn in
> files))):
> > +        if (len(files) < 100 and (match.matchfn == match.exact or
> > +            (not match.anypats() and util.all(fn in self for fn in
> files)))):
> >              return self.intersectfiles(files)
> >
> >          lm = manifestdict('')
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel at selenic.com
> > http://selenic.com/mailman/listinfo/mercurial-devel
>
>  _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150319/60bd8779/attachment.html>


More information about the Mercurial-devel mailing list