Patchwork [4,of,6] perftest: add an option to invalidate volatile cache

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 4, 2013, 6:28 p.m.
Message ID <8ff4097ce3bc5930a133.1357324131@crater2.logilab.fr>
Download mbox | patch
Permalink /patch/395/
State Accepted
Commit a95f1d619bb74598a86a988f8f6e5b2f6865f3b0
Headers show

Comments

Pierre-Yves David - Jan. 4, 2013, 6:28 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1357323760 -3600
# Node ID 8ff4097ce3bc5930a133fccead9c24dfe3318996
# Parent  a5761473ca07eb18e304e804d40804c7799c7a5c
perftest: add an option to invalidate volatile cache

Some revset are sensible to such initialisation. Being able to test the impact
is great.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -259,12 +259,19 @@  def perfrevlog(ui, repo, file_, **opts):
         for x in xrange(0, len(r), dist):
             r.revision(r.node(x))
 
     timer(d)
 
- at command('perfrevset',[],
+ at command('perfrevset',
+         [('C', 'clear', False, 'clear volatile cache between each call.')],
          "REVSET")
-def perfrevset(ui, repo, expr):
-    """benchmark the execution time of a revset"""
+def perfrevset(ui, repo, expr, clear=False):
+    """benchmark the execution time of a revset
+
+    Use the --clean option if need to evaluate the impact of build volative
+    revisions set cache on the revset execution. Volatile cache hold filtered
+    and obsolete related cache."""
     def d():
+        if clear:
+            repo.invalidatevolatilesets()
         repo.revs(expr)
     timer(d)