Author: David Schneider <david.schnei...@picle.org>
Branch: extradoc
Changeset: r4336:7ebb3e6bf30e
Date: 2012-07-23 16:59 +0200
http://bitbucket.org/pypy/extradoc/changeset/7ebb3e6bf30e/

Log:    add a shell script to run the selected benchmarks

        It creates a local checkout of the pypy-benchmarks, updates to a
        fixed revision, patches it so that PYPYLOG is passed to the
        interpreter when running the benchmarks and collects the PYPYLOG
        data in the logs directory

diff --git a/talk/vmil2012/Makefile b/talk/vmil2012/Makefile
--- a/talk/vmil2012/Makefile
+++ b/talk/vmil2012/Makefile
@@ -21,5 +21,8 @@
 figures/benchmarks_table.tex: tool/build_tables.py logs/summary.csv 
tool/table_template.tex
        python tool/build_tables.py logs/summary.csv tool/table_template.tex 
figures/benchmarks_table.tex
 
-logs/summary.csv: tool/difflogs.py
+logs/summary.csv: logs/logbench* tool/difflogs.py
+
+logs::
+       tool/run_benchmarks.sh
        python tool/difflogs.py --diffall logs
diff --git a/talk/vmil2012/tool/env.patch b/talk/vmil2012/tool/env.patch
new file mode 100644
--- /dev/null
+++ b/talk/vmil2012/tool/env.patch
@@ -0,0 +1,12 @@
+diff -r ff7b35837d0f runner.py
+--- a/runner.py        Sat Jul 21 13:35:54 2012 +0200
++++ b/runner.py        Mon Jul 23 16:22:08 2012 +0200
+@@ -28,7 +28,7 @@
+     funcs = perf.BENCH_FUNCS.copy()
+     funcs.update(perf._FindAllBenchmarks(benchmarks.__dict__))
+     opts = ['-b', ','.join(benchmark_set),
+-            '--inherit_env=PATH',
++            '--inherit_env=PATH,PYPYLOG',
+             '--no_charts']
+     if fast:
+         opts += ['--fast']
diff --git a/talk/vmil2012/tool/run_benchmarks.sh 
b/talk/vmil2012/tool/run_benchmarks.sh
new file mode 100755
--- /dev/null
+++ b/talk/vmil2012/tool/run_benchmarks.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+base="$(dirname "${DIR}")"
+bench_list="${base}/logs/benchs.txt"
+benchmarks="${base}/pypy-benchmarks"
+REV="ff7b35837d0f"
+pypy=$(which pypy)
+pypy_opts=",--jit 
enable_opts=intbounds:rewrite:virtualize:string:pure:heap:ffi"
+baseline=$(which true)
+
+# setup a checkout of the pypy benchmarks and update to a fixed revision
+if [ ! -d "${benchmarks}" ]; then
+  echo "Cloning pypy/benchmarks repository to ${benchmarks}"
+  hg clone https://bitbucket.org/pypy/benchmarks "${benchmarks}"
+  cd "${benchmarks}"
+  echo "updating benchmarks to fixed revision ${REV}"
+  hg update "${REV}"
+  echo "Patching benchmarks to pass PYPYLOG to benchmarks"
+  patch -p1 < "$base/tool/env.patch" 
+else
+  cd "${benchmarks}"
+  echo "Clone of pypy/benchmarks already present, reverting changes in the 
checkout"
+  hg revert --all
+  echo "updating benchmarks to fixed revision ${REV}"
+  hg update "${REV}"
+  echo "Patching benchmarks to pass PYPYLOG to benchmarks"
+  patch -p1 < "$base/tool/env.patch" 
+fi
+
+# run each benchmark defined on $bench_list
+while read line
+do
+    logname="${base}/logs/logbench.$(basename "${pypy}").${line}"
+    export PYPYLOG="jit:$logname"
+    bash -c "./runner.py --fast --changed=\"${pypy}\" --args=\"${pypy_opts}\" 
--benchmarks=${line}"
+done < $bench_list
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to