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

xoraxax at codespeak.net xoraxax at codespeak.net
Fri Oct 31 20:45:13 CET 2008


Author: xoraxax
Date: Fri Oct 31 20:45:11 2008
New Revision: 59607

Modified:
   pypy/build/benchmem/report_graphic.py
Log:
Readded timestamp usage, fix bug when certain benchtypes are not available. Now the timestamps are used to deskew the sampling results. Now only the scheduler influences on the main process remain.

Modified: pypy/build/benchmem/report_graphic.py
==============================================================================
--- pypy/build/benchmem/report_graphic.py	(original)
+++ pypy/build/benchmem/report_graphic.py	Fri Oct 31 20:45:11 2008
@@ -82,25 +82,39 @@
 
     def plot_appprofiles(self, name2results, totals):
         """ This function plots incremental memory consumption of app benchmarks
-        (withou interpreter size) versus time (in %s)
+        (without interpreter size if possible) versus time
         """
 
+        SHOW_TS = False
         for name, results in name2results:
             pylab.clf()
             plots = []
             for result in results:
-                lgt = len(result.snapshots)
-                x = [(float(i)/lgt)*100 for i in range(lgt)]
-                y = [snapshot.private - totals[result.executable]
+                timestamps = [float(ss.header['TS']) for ss in result.snapshots]
+                min_ts, max_ts = min(timestamps), max(timestamps)
+                d_ts = max_ts - min_ts
+                if SHOW_TS:
+                    x = [val - min_ts for val in timestamps]
+                else:
+                    x = [(val - min_ts)/d_ts*100 for val in timestamps]
+                if totals:
+                    basesize = totals[result.executable]
+                else:
+                    basesize = 0
+                # XXX measures also the used code pages, this is bad because we do not want to
+                # mix effects because of code generation and GC behaviour
+                y = [snapshot.private - basesize
                      for snapshot in result.snapshots]
                 pylab.title(name)
                 plots.append(pylab.plot(x, y))
 
             pylab.legend(plots, [result.executable for result in results])
-            pylab.xlabel("time (%)")
-            pylab.ylabel("incremental private memory consumption (kB)")
+            xlabel = ["wall clock time (%)", "wall clock time (s)"][SHOW_TS]
+            pylab.xlabel(xlabel)
+            ylabel = ["", "incremental "][bool(basesize)] + "private memory consumption (kB)"
+            pylab.ylabel(ylabel)
             if self.basepath is not None:
-                pylab.savefig(BASE + 'appprofiles_%s.ps' % name)
+                pylab.savefig(self.basepath + 'appprofiles_%s.ps' % name)
             if self.show:
                 pylab.show()
 
@@ -113,7 +127,8 @@
     * ip data
     * private rest
     """
-    
+    if not results:
+        return
     heap_private = numpy.array([result.snapshot.filter(group=HEAP).private
                     for result in results])
     ip_code = numpy.array([result.snapshot.filter(group=result.executable,
@@ -133,7 +148,8 @@
     private memory consumed for object allocation (without base interpreter
     size)
     """
-    
+    if not resultset.results:
+        return
     def incremental_private(result):
         return (result.snapshots[1].heap_private() -
                 result.snapshots[0].heap_private())
@@ -156,7 +172,7 @@
     totals = process_baseint_sizes(resultset.filter(benchtype="basesize").
                                    results, plotter)
     process_objsizes(resultset.filter(benchtype="objsizes"), plotter)
-    plotter.plot_appprofiles(resultset.filter(benchtype="appprofiles"),
+    plotter.plot_appprofiles(resultset.filter(benchtype="appprofiles").getname2results(),
                                 totals)
 
 if __name__ == '__main__':



More information about the Pypy-commit mailing list