[pypy-svn] r60041 - pypy/build/benchmem

xoraxax at codespeak.net xoraxax at codespeak.net
Thu Nov 20 23:59:52 CET 2008


Author: xoraxax
Date: Thu Nov 20 23:59:52 2008
New Revision: 60041

Modified:
   pypy/build/benchmem/report.py
   pypy/build/benchmem/report_graphic.py
Log:
Add pause histogram generation. Has one important problem currently: the bars are rendered over each other. Matplotlibs code does not seem to support multiple series with different lengths, so a better plotter would need to build upon bars.

Modified: pypy/build/benchmem/report.py
==============================================================================
--- pypy/build/benchmem/report.py	(original)
+++ pypy/build/benchmem/report.py	Thu Nov 20 23:59:52 2008
@@ -13,7 +13,7 @@
 parser.add_option("-l", "--benchlog", action="store", dest="benchlog", default="bench.log", 
                   help="logfile to read results from")
 parser.add_option("-g", "--store-graphs", action="store", dest="basepath",
-                  default="", help="optional path to store picture output")
+                  default=None, help="optional path to store picture output")
 parser.add_option("-t", "--no-text", action="store_true", dest="notext",
                   help="disable text reporting")
 parser.add_option("-r", "--no-rest", action="store_true", dest="norest",
@@ -484,6 +484,9 @@
             rows.append(row)
         tw.line(asciitable(rows))
 
+    def run_graphic(self, plotter):
+        plotter.plot_pausehistogram(self.resultset)
+
 
 class AppProfiles(object):
     def __init__(self, resultset):
@@ -515,6 +518,7 @@
         IncrementalSizePerBench(resultset).run_graphic(plotter)
         snapshots = BaseSizeOfInterpreters(resultset).run_graphic(plotter)
         AppProfiles(resultset).run_graphic(plotter, snapshots)
+        Pauses(resultset).run_graphic(plotter)
 
     if not options.norest:
         IncrementalSizePerBench(resultset).run_rest()

Modified: pypy/build/benchmem/report_graphic.py
==============================================================================
--- pypy/build/benchmem/report_graphic.py	(original)
+++ pypy/build/benchmem/report_graphic.py	Thu Nov 20 23:59:52 2008
@@ -119,3 +119,26 @@
             if self.show:
                 pylab.show()
 
+    def plot_pausehistogram(self, resultset):
+        for name, results in resultset.getname2results():
+            pylab.clf()
+            pylab.yscale("log")
+            maxsample = 0
+            range = None
+            for result in results:
+                maxsample = max([maxsample] + result.lst)
+            if maxsample != 0:
+                range = (0, maxsample * 1000)
+            for result in results:
+                samples = [x * 1000 for x in result.lst]
+                legend = "%s-%s" % (result.executable_short, result.benchname)
+                pylab.hist(samples, 10, label=legend, cumulative=False, range=range)
+            pylab.xlabel("Time between two bytecode instruction executions in ms")
+            pylab.ylabel("Executed bytecode instructions")
+            pylab.legend()
+            if self.basepath is not None:
+                pylab.savefig(os.path.join(self.basepath, "pausehistogram_%s%s" % (name, EXT)))
+            if self.show:
+                pylab.show()
+
+



More information about the Pypy-commit mailing list