# HG changeset patch # User hodgestar # Date 1363901926 0 # Node ID 01c29a07522d093a9cd51c229692e5c9af4c31a8 # Parent 2e2d67621904169ba17b3b6eff7d911d7c0a1fc2 Add script for running benchmarks. diff --git a/run_benchmarks.sh b/run_benchmarks.sh new file mode 100644 --- /dev/null +++ b/run_benchmarks.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# +# 1. Run the tests with `tox` (this will set up all the tox envs). +# 2. ./run_benchmarks.sh | tee results-.out + +NAME="$1" +PYTHON="./.tox/$NAME/bin/python" +BENCH_DIR="bench_build/$1" +BENCH_BIN_DIR="$BENCH_DIR/bin" +mkdir -p "bench_build" + +rm -rf "$BENCH_DIR" +cp -R "examples/bench" "$BENCH_DIR" + +case "$NAME" in + py32|py33) + 2to3 -w --no-diffs "$BENCH_DIR" + ;; +esac + +echo "-- basic --" +"$PYTHON" "$BENCH_DIR/basic.py" +echo + +echo "-- bigtable --" +"$PYTHON" "$BENCH_DIR/bigtable.py" +echo + +echo "-- xpath --" +"$PYTHON" "$BENCH_DIR/xpath.py" +echo