[PATCH 9 of 9] revsetbenchmark: add a summary at the end of execution

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Wed Mar 26 21:49:10 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1395885109 25200
#      Wed Mar 26 18:51:49 2014 -0700
# Node ID ddb3327f7d35445133885727b0fd988e536a08dd
# Parent  9f9883d1c6dba67d5ed79f59b5d544b136f43dd4
revsetbenchmark: add a summary at the end of execution

The summary list timing per revset making it much more easier to compare
revision to each other.

diff --git a/contrib/revsetbenchmarks.py b/contrib/revsetbenchmarks.py
--- a/contrib/revsetbenchmarks.py
+++ b/contrib/revsetbenchmarks.py
@@ -76,15 +76,42 @@ print "----------------------------"
 print
 
 
 revs = getrevs(target_rev)
 
+results = []
 for r in revs:
     print "----------------------------"
     printrevision(r)
     print "----------------------------"
     update(r)
+    res = []
+    results.append(res)
     for idx, rset in enumerate(revsets):
-
-        print "%i)" % idx, perf(rset)
+        data = perf(rset)
+        res.append(data)
+        print "%i)" % idx, data
+        sys.stdout.flush()
     print "----------------------------"
 
+
+print """
+
+Result by revset
+================
+"""
+
+print 'Revision:', revs
+for idx, rev in enumerate(revs):
+    sys.stdout.write('%i) ' % idx)
+    sys.stdout.flush()
+    printrevision(rev)
+
+print
+print
+
+for ridx, rset in enumerate(revsets):
+
+    print "revset #%i: %s" % (ridx, rset)
+    for idx, data in enumerate(results):
+        print '%i) %s' % (idx, data[ridx])
+    print


More information about the Mercurial-devel mailing list