revsetbenchmark: add a summary at the end of execution
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 26 Mar 2014 18:51:49 -0700
changeset 20855 dfad9bb23ab4
parent 20854 bad5399c5d5f
child 20856 8a6a86c9a5b5
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.
contrib/revsetbenchmarks.py
--- a/contrib/revsetbenchmarks.py	Wed Mar 26 18:39:56 2014 -0700
+++ b/contrib/revsetbenchmarks.py	Wed Mar 26 18:51:49 2014 -0700
@@ -78,13 +78,40 @@
 
 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