changeset 24350:7002ad149f30

manifest: speed up matches for large sets of files If the number of files being matched is large, the bisection overhead can dominate, which caused a performance regression for revert --all and histedit. This introduces a (fairly arbitrary) cross-over from using bisections to bulk search.
author Matt Mackall <mpm@selenic.com>
date Wed, 18 Mar 2015 13:37:18 -0500
parents 389693a245fa
children cdc4f3af2497
files mercurial/manifest.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/manifest.py	Wed Mar 18 12:03:44 2015 -0500
+++ b/mercurial/manifest.py	Wed Mar 18 13:37:18 2015 -0500
@@ -164,7 +164,7 @@
             return self.copy()
 
         files = match.files()
-        if (match.matchfn == match.exact or
+        if ((match.matchfn == match.exact and len(files) < 100) or
             (not match.anypats() and util.all(fn in self for fn in files))):
             return self.intersectfiles(files)