tags: visit new heads in forward order when rebuilding cache stable
authorMatt Mackall <mpm@selenic.com>
Thu, 26 Jul 2012 17:04:01 -0500
branchstable
changeset 17256 707cbbf950ea
parent 17255 3e856d8abe9c
child 17257 d9626b91623a
tags: visit new heads in forward order when rebuilding cache This improves performance of building the tag cache by 4x on a repo with ~2800 heads.
mercurial/tags.py
--- a/mercurial/tags.py	Fri Jul 27 13:56:19 2012 +0200
+++ b/mercurial/tags.py	Thu Jul 26 17:04:01 2012 -0500
@@ -241,7 +241,7 @@
     # This is the most expensive part of finding tags, so performance
     # depends primarily on the size of newheads.  Worst case: no cache
     # file, so newheads == repoheads.
-    for head in newheads:
+    for head in reversed(newheads):
         cctx = repo[head]
         try:
             fnode = cctx.filenode('.hgtags')