changeset 22780:d8ff1f671aed

perf: add a way to measure the perf of constructing the foldmap Constructing the foldmap is a necessary part of operations like 'hg status' on OS X. This command allows us to measure the perf of constructing it.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 03 Oct 2014 19:58:26 -0700
parents d9585dda63c3
children 70624fda193d
files contrib/perf.py
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Fri Oct 03 18:45:56 2014 -0700
+++ b/contrib/perf.py	Fri Oct 03 19:58:26 2014 -0700
@@ -139,6 +139,16 @@
         del repo.dirstate._dirs
     timer(d)
 
+@command('perfdirstatefoldmap')
+def perffoldmap(ui, repo):
+    dirstate = repo.dirstate
+    'a' in dirstate
+    def d():
+        dirstate._foldmap.get('a')
+        del dirstate._foldmap
+        del dirstate._dirs
+    timer(d)
+
 @command('perfdirstatewrite')
 def perfdirstatewrite(ui, repo):
     ds = repo.dirstate