<div dir="ltr">Thanks. This series looks good to me. I'll leave it to Matt to queue it, in case I'm missing some reason for normpath.<br></div><br><div class="gmail_quote">On Sun, Mar 29, 2015 at 11:39 PM Siddharth Agarwal <<a href="mailto:sid0@fb.com">sid0@fb.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Siddharth Agarwal <<a href="mailto:sid0@fb.com" target="_blank">sid0@fb.com</a>><br>
# Date 1427678928 25200<br>
#      Sun Mar 29 18:28:48 2015 -0700<br>
# Node ID 64ded2aa226dbe1d2e1f96ec476d70<u></u>7cabe8e56e<br>
# Parent  a05be84438fb2a502590b7ae7d5001<u></u>308b558c03<br>
dirstate._walkexplicit: don't bother normalizing '.'<br>
<br>
The overwhelmingly common case is running commands like 'hg diff' with no<br>
arguments. Therefore the only file that'll be listed is the root directory.<br>
Normalizing that's just a waste of time.<br>
<br>
This means that for a plain 'hg diff' we'll never need to construct the<br>
foldmap, saving us a significant chunk of time.<br>
<br>
On case-insensitive HFS+ on OS X, for a large repository with over 200,000<br>
files, this brings down 'hg diff' from 2.97 seconds to 2.36.<br>
<br>
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py<br>
--- a/mercurial/dirstate.py<br>
+++ b/mercurial/dirstate.py<br>
@@ -634,7 +634,9 @@<br>
<br>
         alldirs = None<br>
         for ff in files:<br>
-            if normalize:<br>
+            # constructing the foldmap is expensive, so don't do it for the<br>
+            # common case where files is ['.']<br>
+            if normalize and ff != '.':<br>
                 nf = normalize(ff, False, True)<br>
             else:<br>
                 nf = ff<br>
______________________________<u></u>_________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@selenic.com" target="_blank">Mercurial-devel@selenic.com</a><br>
<a href="http://selenic.com/mailman/listinfo/mercurial-devel" target="_blank">http://selenic.com/mailman/<u></u>listinfo/mercurial-devel</a><br>
</blockquote></div>