changeset 16788:7e72c1609862

perf: add a perfdirstatewrite benchmark
author Bryan O'Sullivan <bryano@fb.com>
date Wed, 16 May 2012 13:45:46 -0700
parents bda96ce993f9
children 977c80123835
files contrib/perf.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/perf.py	Sat May 19 20:21:48 2012 -0700
+++ b/contrib/perf.py	Wed May 16 13:45:46 2012 -0700
@@ -85,6 +85,14 @@
         del repo.dirstate._dirs
     timer(d)
 
+def perfdirstatewrite(ui, repo):
+    ds = repo.dirstate
+    "a" in ds
+    def d():
+        ds._dirty = True
+        ds.write()
+    timer(d)
+
 def perfmanifest(ui, repo):
     def d():
         t = repo.manifest.tip()
@@ -220,6 +228,7 @@
     'perftags': (perftags, []),
     'perfdirstate': (perfdirstate, []),
     'perfdirstatedirs': (perfdirstate, []),
+    'perfdirstatewrite': (perfdirstatewrite, []),
     'perflog': (perflog,
                 [('', 'rename', False, 'ask log to follow renames')]),
     'perftemplating': (perftemplating, []),