# HG changeset patch # User Siddharth Agarwal # Date 1363996980 25200 # Node ID 1413ba4102448cebc47e2c97512dc63eb7c87f47 # Parent d780c472463c5ed767fa278a6b3d49d328d9a114 dirstate.walk: fast path match-always case during traversal This case is a common one -- e.g. `hg status`. For a repository with 170,000 files, this speeds up perfstatus --unknown from 2.15 seconds to 2.09. diff -r d780c472463c -r 1413ba410244 mercurial/dirstate.py --- a/mercurial/dirstate.py Mon Mar 25 14:22:34 2013 -0700 +++ b/mercurial/dirstate.py Fri Mar 22 17:03:00 2013 -0700 @@ -580,6 +580,7 @@ dirignore = util.always matchfn = match.matchfn + matchalways = match.always() badfn = match.bad dmap = self._map normpath = util.normpath @@ -687,15 +688,15 @@ if not ignore(nf): match.dir(nf) wadd(nf) - if nf in dmap and matchfn(nf): + if nf in dmap and (matchalways or matchfn(nf)): results[nf] = None elif kind == regkind or kind == lnkkind: if nf in dmap: - if matchfn(nf): + if matchalways or matchfn(nf): results[nf] = st - elif matchfn(nf) and not ignore(nf): + elif (matchalways or matchfn(nf)) and not ignore(nf): results[nf] = st - elif nf in dmap and matchfn(nf): + elif nf in dmap and (matchalways or matchfn(nf)): results[nf] = None for s in subrepos: