forked from stateright/stateright
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbench.sh
More file actions
executable file
·34 lines (29 loc) · 752 Bytes
/
Copy pathbench.sh
File metadata and controls
executable file
·34 lines (29 loc) · 752 Bytes
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
#!/bin/bash
set -e
set -u
COUNT=${1:-3}
FILTER=${2:-''}
echo "Benchmarking with:" >&2
echo "- COUNT=$COUNT" >&2
echo "- FILTER='$FILTER'" >&2
echo >&2
# USAGE: bench EXAMPLE ARGS...
# EXAMPLE: bench 2pc check 9
#
# No-op if EXAMPLE does not match FILTER.
bench() {
if [[ $1 == *"$FILTER"* ]]; then
echo "== $@ =="
for i in $(seq $COUNT); do
cargo -q run --release --example "$@" |grep "sec="
done
fi
}
bench 2pc check 10
bench paxos check 6
bench single-copy-register check 4
bench linearizable-register check 2
if [[ "$FILTER" == '' ]]; then
# This test takes particularly long so it's only run when the filter is empty.
bench linearizable-register check 3 ordered
fi