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

Augie Fackler raf at durin42.com
Thu Mar 19 08:24:47 CDT 2015


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


More information about the Mercurial-devel mailing list