changeset 18845:c1f416e4bc80

perf: add perfdirs command This measures the cost of computing the dirstate's dirs structure, which becomes very expensive in a large working directory.
author Bryan O'Sullivan <bryano@fb.com>
date Mon, 01 Apr 2013 13:46:32 -0700
parents 37f8baaf31d2
children 860d36b763ae
files contrib/perf.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Mon Apr 01 15:19:16 2013 -0500
+++ b/contrib/perf.py	Mon Apr 01 13:46:32 2013 -0700
@@ -99,6 +99,15 @@
             rev in s
     timer(d)
 
+@command('perfdirs')
+def perfdirs(ui, repo):
+    dirstate = repo.dirstate
+    'a' in dirstate
+    def d():
+        dirstate.dirs()
+        del dirstate._dirs
+    timer(d)
+
 @command('perfdirstate')
 def perfdirstate(ui, repo):
     "a" in repo.dirstate