changeset 20855:dfad9bb23ab4

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 26 Mar 2014 18:51:49 -0700
parents bad5399c5d5f
children 8a6a86c9a5b5
files contrib/revsetbenchmarks.py
diffstat 1 files changed, 29 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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