Files
fs2open.github.com/scripts/performance_check.sh
T
asarium dd56493543 Add script for doing automated performance test
This script allows to compare the performance of a branch to master by
running both versions and generating a graph of frametimes for both
versions.
2016-09-11 16:21:32 +02:00

47 lines
1.0 KiB
Bash

#!/usr/bin/env bash
# This script tests for performance changes between two branches in this repository.
set -ex
if [ "$#" -lt 1 ] || [ "$1" == "--help" ]; then
echo "Runs FSO two times based off different branches to compare their performance"
echo "Usage: ./performance_check.sh <test_branch> <fso_parameters>*"
exit 1
fi
BRANCH="$1"
shift
echo "$*"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
FSO_REPO=$(readlink -f "$DIR/../")
FSO_DIR="$(printenv FS2PATH)"
cd "$FSO_REPO"
mkdir -p build/performance_test
function run_test {
pushd build/performance_test
NAME="$1"
shift
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DFSO_RUN_ARGUMENTS="$*" -DFSO_FREESPACE_PATH="$FSO_DIR" "${FSO_REPO}"
ninja launch_fso
cp "$FSO_DIR/profiling.csv" "/tmp/$NAME.csv"
popd
}
git checkout master
run_test master "$@"
git checkout "${BRANCH}"
run_test changed "$@"
$DIR/performance_graph.py --base_data "/tmp/master.csv" --base_title "master" \
--changed_data "/tmp/changed.csv" --changed_title "${BRANCH}"