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

login
register
mail settings
Submitter Pierre-Yves David
Date March 27, 2014, 2:49 a.m.
Message ID <ddb3327f7d3544513388.1395888550@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4088/
State Accepted
Commit dfad9bb23ab49bd461544c1d5fab3318ab637d23
Headers show

Comments

Pierre-Yves David - March 27, 2014, 2:49 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.
Matt Mackall - March 27, 2014, 3:40 p.m.
On Wed, 2014-03-26 at 19:49 -0700, pierre-yves.david@ens-lyon.org wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@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

These are queued for default, thanks.

Patch

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