Repository navigation
Expand file tree
/
Copy pathbenchmark.sh
More file actions
executable file
·46 lines (41 loc) · 1.71 KB
/
Copy pathbenchmark.sh
File metadata and controls
executable file
·46 lines (41 loc) · 1.71 KB
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
#!/bin/bash
#
# Run prediction speed benchmarks with recommended JVM settings.
#
# Usage:
# ./benchmark.sh # run with defaults
# ./benchmark.sh -r 20 -i 500 # 20 measured rounds, 500 iters each
# ./benchmark.sh -t 200 -d 15 # 200 trees, max depth 15
# ./benchmark.sh -n 69500 # tile dataset to 69500 rows
# ./benchmark.sh -r 20 -i 500 -t 200 -d 15 # all params
#
# Parameters:
# -r MEASURE_ROUNDS number of measured rounds (default: 10)
# -i ITERS_PER_ROUND prediction iterations per round (default: 400)
# -t NUM_TREES number of trees in the forest (default: 100)
# -d TREE_DEPTH max tree depth (0 = unlimited) (default: 0)
# -n BATCH_SIZE batch rows, tiled from dataset (default: 0 = dataset size)
set -euo pipefail
MEASURE_ROUNDS=""
ITERS_PER_ROUND=""
NUM_TREES=""
TREE_DEPTH=""
BATCH_SIZE=""
while getopts "r:i:t:d:n:" opt; do
case $opt in
r) MEASURE_ROUNDS="$OPTARG" ;;
i) ITERS_PER_ROUND="$OPTARG" ;;
t) NUM_TREES="$OPTARG" ;;
d) TREE_DEPTH="$OPTARG" ;;
n) BATCH_SIZE="$OPTARG" ;;
*) echo "Usage: $0 [-r rounds] [-i iters] [-t trees] [-d depth] [-n batchSize]" >&2; exit 1 ;;
esac
done
shift $((OPTIND - 1))
PROPS=""
[ -n "$MEASURE_ROUNDS" ] && PROPS="$PROPS -Dbench.measureRounds=$MEASURE_ROUNDS"
[ -n "$ITERS_PER_ROUND" ] && PROPS="$PROPS -Dbench.itersPerRound=$ITERS_PER_ROUND"
[ -n "$NUM_TREES" ] && PROPS="$PROPS -Dbench.numTrees=$NUM_TREES"
[ -n "$TREE_DEPTH" ] && PROPS="$PROPS -Dbench.treeDepth=$TREE_DEPTH"
[ -n "$BATCH_SIZE" ] && PROPS="$PROPS -Dbench.batchSize=$BATCH_SIZE"
./gradlew benchmark $PROPS "$@"