# HG changeset patch # User Siddharth Agarwal # Date 1363997029 25200 # Node ID a18919de61e5a11747a8856e6acfbaaa457fb479 # Parent 1413ba4102448cebc47e2c97512dc63eb7c87f47 dirstate.walk: fast path none-seen + match-always case for step 3 This case is a common one -- e.g. `hg diff`. For a repository with 170,000 files, this speeds up perfstatus from 0.95 seconds to 0.88. diff -r 1413ba410244 -r a18919de61e5 mercurial/dirstate.py --- a/mercurial/dirstate.py Fri Mar 22 17:03:00 2013 -0700 +++ b/mercurial/dirstate.py Fri Mar 22 17:03:49 2013 -0700 @@ -705,7 +705,12 @@ # step 3: report unseen items in the dmap hash if not skipstep3 and not exact: - visit = sorted([f for f in dmap if f not in results and matchfn(f)]) + if not results and matchalways: + visit = dmap.keys() + else: + visit = [f for f in dmap if f not in results and matchfn(f)] + visit.sort() + if unknown: # unknown == True means we walked the full directory tree above. # So if a file is not seen it was either a) not matching matchfn