#!/usr/bin/env bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # Where are the svn binaries you want to benchmark? if [ "$USER" = "neels" ]; then SVN_A_NAME="1.7.x" SVN_A="$HOME/pat/bench/prefix/bin/svn" SVN_B_NAME="trunk" SVN_B="$HOME/pat/trunk/prefix/bin/svn" else SVN_A_NAME="1.6" SVN_A="$HOME/src/svn-1.6.x/subversion/svn/svn" SVN_B_NAME="trunk" SVN_B="$HOME/src/svn/subversion/svn/svn" fi benchmark="$PWD/benchmark.py" parent="$(date +"%Y%m%d-%H%M%S")" inital_workdir="$PWD" mkdir "$parent" cd "$parent" pwd batch(){ levels="$1" spread="$2" N="$3" pre="${levels}x${spread}_" echo echo "---------------------------------------------------------------------" echo echo "Results for dir levels: $levels spread: $spread" "$benchmark" "--svn=$SVN_A" run "${pre}$SVN_A_NAME" $levels $spread $N >/dev/null "$benchmark" "--svn=$SVN_B" run "${pre}$SVN_B_NAME" $levels $spread $N >/dev/null "$benchmark" compare "${pre}$SVN_A_NAME" "${pre}$SVN_B_NAME" } N=6 al=5 as=5 bl=100 bs=1 cl=1 cs=100 ##DEBUG #N=1 #al=1 #as=1 #bl=2 #bs=1 #cl=1 #cs=2 ##DEBUG { started="$(date)" echo "Started at $started" echo "" batch $al $as $N batch $bl $bs $N batch $cl $cs $N echo "" echo ========================================================================= echo "" "$benchmark" combine "total_$SVN_A_NAME" *x*"_$SVN_A_NAME" >/dev/null "$benchmark" combine "total_$SVN_B_NAME" *x*"_$SVN_B_NAME" >/dev/null echo "comparing averaged totals..." "$benchmark" compare "total_$SVN_A_NAME" "total_$SVN_B_NAME" echo "" echo "Had started at $started," echo " done at $(date)" pwd } 2>&1 | tee results.txt cd "$inital_workdir" if [ -f "$parent/total_trunk" ]; then rm -rf "$parent" fi