comparison mercurial/manifest.py @ 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 149cc171e4a0
children 9e03602cd2d8
comparison
equal deleted inserted replaced
24349:389693a245fa 24350:7002ad149f30
162 '''generate a new manifest filtered by the match argument''' 162 '''generate a new manifest filtered by the match argument'''
163 if match.always(): 163 if match.always():
164 return self.copy() 164 return self.copy()
165 165
166 files = match.files() 166 files = match.files()
167 if (match.matchfn == match.exact or 167 if ((match.matchfn == match.exact and len(files) < 100) or
168 (not match.anypats() and util.all(fn in self for fn in files))): 168 (not match.anypats() and util.all(fn in self for fn in files))):
169 return self.intersectfiles(files) 169 return self.intersectfiles(files)
170 170
171 lm = manifestdict('') 171 lm = manifestdict('')
172 lm._lm = self._lm.filtercopy(match) 172 lm._lm = self._lm.filtercopy(match)