[pypy-svn] r40148 - pypy/dist/pypy/translator/benchmark

arigo at codespeak.net arigo at codespeak.net
Fri Mar 9 23:21:38 CET 2007


Author: arigo
Date: Fri Mar  9 23:21:35 2007
New Revision: 40148

Modified:
   pypy/dist/pypy/translator/benchmark/result.py
Log:
Improve table column titles.


Modified: pypy/dist/pypy/translator/benchmark/result.py
==============================================================================
--- pypy/dist/pypy/translator/benchmark/result.py	(original)
+++ pypy/dist/pypy/translator/benchmark/result.py	Fri Mar  9 23:21:35 2007
@@ -1,12 +1,17 @@
 import os, pickle, sys, time, re
 
-stat2title = {
+STAT2TITLE = {
     'stat:st_mtime':  "date",
     'exe_name':       "executable",
-    'bench:richards': "richards",
-    'bench:pystone':  "pystone",
 }
 
+def stat2title(s):
+    if s.startswith('bench:'):
+        return s[6:]
+    else:
+        return STAT2TITLE.get(s, s)
+
+
 class BenchmarkResultSet(object):
     def __init__(self, max_results=10):
         self.benchmarks = {}
@@ -27,7 +32,7 @@
             filteron = kw['filteron']
             lst = [r for r in lst if filteron(r)]
         relto = kw.get('relto', None)
-        table = [[(stat2title.get(s,s),0) for s in stats]]
+        table = [[(stat2title(s),0) for s in stats]]
         for r in lst:
             row = []
             for stat in stats:



More information about the Pypy-commit mailing list