-
Notifications
You must be signed in to change notification settings - Fork 0
/
bench.sh
executable file
·44 lines (34 loc) · 942 Bytes
/
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
#!/bin/bash
# Helper script to run benchmarks with a reasonable default configuration.
set -e
info() {
echo -e "\\033[1;37m${1}\\033[0m"
}
die() {
echo "$1" 1>&2
exit 1
}
main() {
if [ -z "$1" ]; then
die "Usage: bench.sh <path to specious-bench> <args for specious-bench>"
fi
BENCH_BIN="$1"
shift
if ! [ -f "$BENCH_BIN" ] && ! command -v "$BENCH_BIN" >/dev/null; then
die "could not find executable $BENCH_BIN" 1>&2
fi
info "mem"
"$BENCH_BIN" -db mem -benchmarks=fillrandom,readrandom "$@"
echo
info "specious"
local benchmarks="fillseq,readseq,init,fillrandom,readrandom,\
fs-write,fs-read"
"$BENCH_BIN" -db specious -final-compact -delete-db \
-benchmarks="$benchmarks" "$@"
echo
info "leveldb"
local benchmarks="fillseq,readseq,init,fillrandom,readrandom"
"$BENCH_BIN" -db leveldb -final-compact -delete-db \
-benchmarks="$benchmarks" "$@"
}
main "$@"