[pypy-svn] r70663 - in pypy/build/bot2/jsplot: . js test

fijal at codespeak.net fijal at codespeak.net
Sun Jan 17 21:20:33 CET 2010


Author: fijal
Date: Sun Jan 17 21:20:31 2010
New Revision: 70663

Modified:
   pypy/build/bot2/jsplot/js/collect.js
   pypy/build/bot2/jsplot/js/plot.js
   pypy/build/bot2/jsplot/plotsummary.html
   pypy/build/bot2/jsplot/test/jstest_collect_any.js
Log:
Improve the look of benchmarks. Also have some more info there


Modified: pypy/build/bot2/jsplot/js/collect.js
==============================================================================
--- pypy/build/bot2/jsplot/js/collect.js	(original)
+++ pypy/build/bot2/jsplot/js/collect.js	Sun Jan 17 21:20:31 2010
@@ -15,7 +15,8 @@
             var cpyend = benchresults[benchresults.length - 1][0];
             var cpyval = this.plotdata.cpytimes[benchname];
             var cpython_results = [[cpystart, cpyval], [cpyend, cpyval]]
-            this.plot(benchname, benchresults, cpython_results)
+            this.plot(benchname, benchresults, cpython_results,
+                      this.plotdata.lasttimes[benchname])
         }
     }
 
@@ -56,6 +57,7 @@
 {
     var retval = {};
     var cpytimes = {};
+    var lasttimes = {}
     var lastrev = 0;
     var lastrevindex = 0;
     for (var i = 0; i < data.length; i++) {
@@ -97,11 +99,14 @@
         var benchname = cpyelem.results[i][0];
         if (dataelem.avg_base) {
             cpytimes[benchname] = dataelem.avg_base;
+            lasttimes[benchname] = dataelem.delta_avg;
         } else {
             cpytimes[benchname] = dataelem.base_time;
+            lasttimes[benchname] = dataelem.time_delta;
         }
     }
-    return {'results': retval, 'cpytimes': cpytimes};
+    return {'results': retval, 'cpytimes': cpytimes,
+            'lasttimes': lasttimes};
 }
 
 function extract_revnos(xmldoc)

Modified: pypy/build/bot2/jsplot/js/plot.js
==============================================================================
--- pypy/build/bot2/jsplot/js/plot.js	(original)
+++ pypy/build/bot2/jsplot/js/plot.js	Sun Jan 17 21:20:31 2010
@@ -43,21 +43,31 @@
 
 var MAX_PER_LINE = 4;
 
-function plot_miniature(benchname, benchresults, cpython_results)
+function plot_miniature(benchname, benchresults, cpython_results, lasttime)
 {
     if ($("#placeholder").find("td").length % MAX_PER_LINE == 0) {
         $("#placeholder").append("<tr></tr>");
     }
-    $("#placeholder").find("tr:last").append("<td><p class='smallcaption'>" + benchname + "</p><div class='miniplot'></div></td>");
+    var capt = benchname + " " + lasttime;
+    $("#placeholder").find("tr:last").append("<td><p class='smallcaption'>" + capt + "</p><div class='miniplot'></div></td>");
     var elem = $("#placeholder").find("div:last");
     var attrs = common_attrs();
     attrs.xaxis.ticks = 0;
     attrs.yaxis.ticks = 0;
-    $.plot(elem, [benchresults, cpython_results], attrs);
+    var data;
+    if (!$("#legend").children() == []) {
+        // a bit of a hack, if we didn't add a legend, do it now
+        data = get_plot_input(benchresults, cpython_results);
+        attrs.legend.container = "#legend";
+    } else {
+        data = [benchresults, cpython_results];
+    }
+    $.plot(elem, data, attrs);
 }
 
-function plot_main(benchname, benchresults, cpython_results) {
-    $("#placeholder").append("<p class='caption'>" + benchname + "</p>");
+function plot_main(benchname, benchresults, cpython_results, lasttime) {
+    var capt = benchname + " " + lasttime;
+    $("#placeholder").append("<p class='caption'>" + capt + "</p>");
     $("#placeholder").append("<div class='plot'></div>");
     var plotinput = get_plot_input(benchresults, cpython_results)
     $.plot($("#placeholder").children(":last"), plotinput, common_attrs());

Modified: pypy/build/bot2/jsplot/plotsummary.html
==============================================================================
--- pypy/build/bot2/jsplot/plotsummary.html	(original)
+++ pypy/build/bot2/jsplot/plotsummary.html	Sun Jan 17 21:20:31 2010
@@ -15,6 +15,11 @@
   </head>
   <body>
     <h1>Benchmarks</h1>
+    <p>
+      On <i>X</i> axis revision number, on <i>Y</i> axis time for benchmark (lower is better).
+    </p>
+    <div id="legend">
+    </div>
     <table id="placeholder">
       <tr>
       </tr>

Modified: pypy/build/bot2/jsplot/test/jstest_collect_any.js
==============================================================================
--- pypy/build/bot2/jsplot/test/jstest_collect_any.js	(original)
+++ pypy/build/bot2/jsplot/test/jstest_collect_any.js	Sun Jan 17 21:20:31 2010
@@ -30,6 +30,7 @@
     benchnames.sort();
     aisDeeply(benchnames, expected_benchnames);
     ais(bench_data.cpytimes.ai, 0.43372206687940001);
+    ais(bench_data.lasttimes.ai, "1.0207x faster");
 },
 
 test_extract_revnos: function() {



More information about the Pypy-commit mailing list