1#!/bin/sh
2
3set -e
4
5BRANCH=$(git branch | grep \* | cut -d" "  -f 2)
6CLEAN=${CLEAN-clean}
7SAMPLES=100
8
9if [ "$BRANCH" = "$CLEAN" ]; then
10    echo "Comparing $BRANCH to itself."
11    exit 1
12fi
13
14if [ ! -f $CLEAN.log ]; then
15    git checkout $CLEAN
16    python gyp_skia >/dev/null
17    ninja -C out/Release nanobench
18    out/Release/nanobench $@ --samples $SAMPLES -v 2> $CLEAN.log
19fi
20
21git checkout $BRANCH
22python gyp_skia >/dev/null
23ninja -C out/Release nanobench
24out/Release/nanobench $@ --samples $SAMPLES -v 2> $BRANCH.log
25
26python bin/compare $CLEAN.log $BRANCH.log
27