[pypy-svn] r33948 - pypy/dist/pypy/translator/goal

ericvrp at codespeak.net ericvrp at codespeak.net
Tue Oct 31 14:16:04 CET 2006


Author: ericvrp
Date: Tue Oct 31 14:15:58 2006
New Revision: 33948

Modified:
   pypy/dist/pypy/translator/goal/bench-cronjob.py
   pypy/dist/pypy/translator/goal/bench-unix.py
Log:
Added microbench results to the nightly benchmark


Modified: pypy/dist/pypy/translator/goal/bench-cronjob.py
==============================================================================
--- pypy/dist/pypy/translator/goal/bench-cronjob.py	(original)
+++ pypy/dist/pypy/translator/goal/bench-cronjob.py	Tue Oct 31 14:15:58 2006
@@ -17,8 +17,10 @@
 def run(cmd):
     print 'RUN:', cmd
     sys.stdout.flush()
+    result = 0  #OK
     if not dry_run:
-        os.system(cmd)
+        result = os.system(cmd) #note: result is system dependent but works on Linux the way we want
+    return result
 
 def update_pypy():
     os.chdir(homedir + '/projects/pypy-dist')
@@ -144,13 +146,11 @@
     return buf
 
 def benchmark():
-    #run('cat /proc/cpuinfo')
-    #run('free')
     os.chdir(homedir + '/projects/pypy-dist/pypy/translator/goal')
     startload = get_load()
-    run('/usr/local/bin/withlock /tmp/cpu_cycles_lock /usr/local/bin/python bench-unix.py 2>&1 | tee benchmark.txt' % locals())
+    result = run('/usr/local/bin/withlock /tmp/cpu_cycles_lock /usr/local/bin/python bench-unix.py 2>&1 | tee benchmark.txt' % locals())
     endload = get_load()
-    if not dry_run:
+    if not dry_run and result == 0:
         f = open('benchmark.html', 'w')
         print >> f, "<html><body>"
         print >> f, "<pre>"
@@ -161,20 +161,16 @@
         print >> f, "</pre>"
         print >> f, "</body></html>"
         f.close()
-    #run('scp benchmark.html ericvrp at codespeak.net:public_html/benchmark/index.html')
 
 def main(backends=[]):
     if backends == []:  #_ prefix means target specific option, # prefix to outcomment
         backends = [backend.strip() for backend in """
-            #llvm
             llvm--_objspace-std-withstrdict
             c
             c--gc=framework
             c--_thread
             c--stackless
-            #c--gc=framework--cc=c++
-            #c--cc=c++
-            #c--_objspace-std-withstrdict
+            c--stackless--_objspace-std-withstrdict--profopt='-c "from richards import *;main(iterations=1)"'
             c--profopt='-c "from richards import *;main(iterations=1)"'
             c--_objspace-std-withstrdict--profopt='-c "from richards import *;main(iterations=1)"'
             c--gc=framework--_objspace-std-withstrdict--profopt='-c "from richards import *;main(iterations=1)"'

Modified: pypy/dist/pypy/translator/goal/bench-unix.py
==============================================================================
--- pypy/dist/pypy/translator/goal/bench-unix.py	(original)
+++ pypy/dist/pypy/translator/goal/bench-unix.py	Tue Oct 31 14:15:58 2006
@@ -99,7 +99,7 @@
 
     ref_rich, ref_stone = None, None
 
-    for exe in 'python2.4 python2.3'.split():
+    for exe in '/usr/local/bin/python2.5 python2.4 python2.3'.split():
         v = os.popen(exe + ' -c "import sys;print sys.version.split()[0]"').read().strip()
         if not v:
             continue
@@ -117,16 +117,24 @@
         if not ref_stone:
             ref_stone = stone
 
-        fmt = '%-26s %8s %8s    %-48s   %6dms (%6.1fx)   %6d (%6.1fx)'
-        print fmt % (time.ctime(), '-', '-', 'CPython ' + v, rich, rich / ref_rich, stone, stone / ref_stone)
+        fmt = '%-26s %8s %8s    <a href="microbench-archive/%s.txt">%-48s</a>   %6dms (%6.1fx)   %6d (%6.1fx)'
+        print fmt % (time.ctime(), '-', '-', 'python', 'CPython ' + v, rich, rich / ref_rich, stone, stone / ref_stone)
         sys.stdout.flush()
 
     for exe in get_executables():
         exename = os.path.splitext(exe)[0].lstrip('./')
         ctime   = time.ctime( os.path.getmtime(exename) )
 
+        #compute microbenchmark results (only once)
+        f = '../microbench/archive/%s.txt' % exe
+        if not os.path.exists(f) or os.stat(f).st_size < 100:
+            os.chdir('../microbench')
+            run_cmd('./microbench.py python "../goal/%s" > "archive/%s.txt"' % (exe, exe))
+            os.chdir('../goal')
+            
         r = exe + '_richards'
         if not benchmark_result.is_stable(r):
+            #continue with our regular benchmarks
             benchmark_result.update(r, run_richards(exe, 1), RICHARDS_ASCENDING_GOOD)
         rich = benchmark_result.get_best_result(r)
 
@@ -137,7 +145,7 @@
 
         codesize = os.popen('size "%s" | tail -n1 | cut -f1'%(exename,)).read().strip()
 
-        print fmt % (ctime, os.path.getsize(exe), codesize, exename, rich, rich / ref_rich, stone, ref_stone / stone)
+        print fmt % (ctime, os.path.getsize(exe), codesize, exename, exename, rich, rich / ref_rich, stone, ref_stone / stone)
         sys.stdout.flush()
 
 if __name__ == '__main__':



More information about the Pypy-commit mailing list