Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r125:a8836ad0cec7
Date: 2011-07-16 17:15 +0200
http://bitbucket.org/pypy/benchmarks/changeset/a8836ad0cec7/

Log:    improve uploading so we can benchmark pypy against pypy no jit

diff --git a/runner.py b/runner.py
--- a/runner.py
+++ b/runner.py
@@ -2,12 +2,30 @@
 """ Usage: runner.py <result filename> <path to pypy-c> <revnumber>
 """
 
-import os
 import json
 import sys
 from unladen_swallow import perf
 import benchmarks
 import socket
+
+def perform_upload(pypy_c_path, args, force_host, options, res, revision,
+                   changed=True):
+    from saveresults import save
+    project = 'PyPy'
+    if "--jit" in args:
+        name = "pypy-c"
+    else:
+        name = "pypy-c-jit"
+    if "psyco.sh" in pypy_c_path:
+        name = "cpython psyco-profile"
+        revision = 100
+        project = 'cpython'
+    if force_host is not None:
+        host = force_host
+    else:
+        host = socket.gethostname()
+    print save(project, revision, res, options, name, host, changed=changed)
+
         
 def run_and_store(benchmark_set, result_filename, pypy_c_path, revision=0,
                   options='', branch='trunk', args='', upload=False,
@@ -36,21 +54,15 @@
         }))
     f.close()
     if upload:
-        from saveresults import save
-        project = 'PyPy'
-        if "--jit threshold" in args:
-            name = "pypy-c"
+        if ',' in args:
+            argsbase, argschanged = args.split(',')
         else:
-            name = "pypy-c-jit"
-        if "psyco.sh" in pypy_c_path:
-            name = "cpython psyco-profile"
-            revision = 100
-            project = 'cpython'
-        if force_host is not None:
-            host = force_host
-        else:
-            host = socket.gethostname()
-        save(project, revision, res, options, name, host)
+            argsbase, argschanged = args, args
+        if 'pypy' in baseline:
+            perform_upload(pypy_c_path, argsbase, force_host, options, res,
+                           revision, changed=False)
+        perform_upload(pypy_c_path, argschanged, force_host, options, res,
+                       revision, changed=True)
 
 BENCHMARK_SET = ['richards', 'slowspitfire', 'django', 'spambayes',
                  'rietveld', 'html5lib', 'ai']
diff --git a/saveresults.py b/saveresults.py
--- a/saveresults.py
+++ b/saveresults.py
@@ -8,7 +8,8 @@
 
 SPEEDURL = "http://speed.pypy.org/";
 
-def save(project, revision, results, options, interpreter, host, 
testing=False):
+def save(project, revision, results, options, interpreter, host, testing=True,
+         changed=True):
     testparams = []
     #Parse data
     data = {}
@@ -20,9 +21,15 @@
         results = b[2]
         value = 0
         if res_type == "SimpleComparisonResult":
-            value = results['changed_time']
+            if changed:
+                value = results['changed_time']
+            else:
+                value = results['base_time']
         elif res_type == "ComparisonResult":
-            value = results['avg_changed']
+            if changed:
+                value = results['avg_changed']
+            else:
+                value = results['avg_base']
         else:
             print("ERROR: result type unknown " + b[1])
             return 1
@@ -35,7 +42,10 @@
             'result_value': value,
         }
         if res_type == "ComparisonResult":
-            data['std_dev'] = results['std_changed']
+            if changed:
+                data['std_dev'] = results['std_changed']
+            else:
+                data['std_dev'] = results['std_base']
         if testing: testparams.append(data)
         else: error |= send(data)
     if error:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to