changeset 18018:0fed3fe45ea7

dirstate: avoid use of zip on big lists In a clean working directory containing 170,000 tracked files, this improves performance of "hg --time diff" from 1.69 seconds to 1.43. This idea is due to Siddharth Agarwal.
author Bryan O'Sullivan <bryano@fb.com>
date Fri, 30 Nov 2012 15:55:08 -0800
parents 74912fe3d718
children e248bff2d8dd
files mercurial/dirstate.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Fri Nov 30 15:55:07 2012 -0800
+++ b/mercurial/dirstate.py	Fri Nov 30 15:55:08 2012 -0800
@@ -696,8 +696,9 @@
         # 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)])
-            for nf, st in zip(visit, util.statfiles([join(i) for i in visit])):
-                results[nf] = st
+            nf = iter(visit).next
+            for st in util.statfiles([join(i) for i in visit]):
+                results[nf()] = st
         for s in subrepos:
             del results[s]
         del results['.hg']