2019-08-13 04:03:56 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
|
|
|
|
2019-09-03 00:46:05 +08:00
|
|
|
if [ -z "$CHECKPERF_REPOSITORY"]; then CHECKPERF_REPOSITORY=.; fi
|
|
|
|
|
2019-08-13 04:03:56 +08:00
|
|
|
# Arguments: perfdiff.sh <branch> <test json files>
|
|
|
|
if [ -z "$1" ]; then reference_branch="master"; else reference_branch=$1; shift; fi
|
|
|
|
if [ -z "$*" ]; then perftests="jsonexamples/twitter.json"; else perftests=$*; fi
|
|
|
|
|
|
|
|
# Clone and build the reference branch's parse
|
|
|
|
echo "Cloning and build the reference branch ($reference_branch) ..."
|
2019-08-16 08:43:21 +08:00
|
|
|
current=$SCRIPTPATH/..
|
2019-08-13 04:03:56 +08:00
|
|
|
reference=$current/benchbranch/$reference_branch
|
|
|
|
rm -rf $reference
|
|
|
|
mkdir -p $reference
|
2019-09-03 00:46:05 +08:00
|
|
|
git clone --depth 1 -b $reference_branch $CHECKPERF_REPOSITORY $reference
|
2019-08-13 04:03:56 +08:00
|
|
|
cd $reference
|
|
|
|
make parse
|
|
|
|
|
|
|
|
# Build the current branch's parse
|
|
|
|
echo "Building the current branch ..."
|
|
|
|
cd $current
|
|
|
|
make clean
|
|
|
|
make parse
|
|
|
|
|
|
|
|
# Run them and diff performance
|
|
|
|
make perfdiff
|
|
|
|
|
|
|
|
echo "Running perfdiff:"
|
2019-10-02 00:01:09 +08:00
|
|
|
echo ./perfdiff \"$current/parse -t $perftests $CHECKPERF_ARGS\" \"$reference/parse -t $perftests $CHECKPERF_ARGS\"
|
|
|
|
./perfdiff "$current/parse -t $perftests $CHECKPERF_ARGS" "$reference/parse -t $perftests $CHECKPERF_ARGS"
|