-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_bench.sh
executable file
·64 lines (49 loc) · 1.41 KB
/
run_bench.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
set -e
TIMESTAMP=$(date +"%Y%m%d_%H:%M:%S")
NUM_RUNS_DEFAULT=10
usage() {
exec >&2
printf "Usage: %s [-n NUM_RUNS]\n\n" "$(basename $0)"
printf " -n NUM_RUNS the number of runs for each test case (defaults to $NUM_RUNS_DEFAULT)\n"
exit 2
}
ARGS=""
while getopts ":n:h" opt
do
case "$opt" in
(n) if [ $((OPTARG)) -le 0 ]
then
printf "NUM_RUNS must be a positive number; got '%s'\n\n" "$OPTARG"
usage
fi
ARGS="$ARGS -n $OPTARG"
;;
(h) usage
;;
(*) printf "Unrecognized argument '%s'\n\n" "$OPTARG"
usage
;;
esac
done
shift $((OPTIND - 1))
[ $# -eq 0 ] || usage
cd bench
mkdir ${TIMESTAMP}
./mk_micro.sh
MICRO_RAW=$(mktemp)
printf "BENCHMARKING LAZY MODE\n"
BENCH_LAZY="${TIMESTAMP}/lazy_bench.log"
./bench.sh $ARGS >"$BENCH_LAZY"
./bench.sh -d micro $ARGS >"$MICRO_RAW"
MICRO_LAZY="${TIMESTAMP}/lazy_micro.log"
./fixup_micro.sh "$MICRO_RAW" >"$MICRO_LAZY"
printf "BENCHMARKING EAGER MODE\n"
BENCH_EAGER="${TIMESTAMP}/eager_bench.log"
FFS_ARGS="--eager" ./bench.sh $ARGS >"$BENCH_EAGER"
FFS_ARGS="--eager" ./bench.sh -d micro $ARGS >"$MICRO_RAW"
MICRO_EAGER="${TIMESTAMP}/eager_micro.log"
./fixup_micro.sh "$MICRO_RAW" >"$MICRO_EAGER"
rm "$MICRO_RAW"
./generate_charts.R "$BENCH_LAZY" "$MICRO_LAZY"
./generate_charts.R "$BENCH_EAGER" "$MICRO_EAGER"