forked from kbss-cvut/otm-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark.sh
executable file
·145 lines (125 loc) · 4.3 KB
/
benchmark.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/bash
JAVA=/opt/java-8-oracle/bin/java
OUTPUT=benchmark.log
LOGFILE=logback.xml
WARMUPS=20
ROUNDS=100
EXECUTIONS=5
MEMORY=(32m 64m 128m 256m 512m 1g)
DATA_DIR=data
GRAPHDB_HOME=~/Java/graphdb-free-8.4.1/
GRAPHDB_PIDFILE=/tmp/.graphdbpid
start_graphdb()
{
${GRAPHDB_HOME}/bin/graphdb -d -s -p ${GRAPHDB_PIDFILE};
sleep 20 # Sleep to give GraphDB time to start
}
stop_graphdb()
{
kill $(<"${GRAPHDB_PIDFILE}")
sleep 2
}
restart_graphdb()
{
stop_graphdb
start_graphdb
}
start_repository()
{
start_graphdb
}
stop_repository()
{
stop_graphdb
}
restart_repository()
{
stop_repository
start_repository
}
execute_with_provider()
{
cd ${1}/target
echo "Create..."
echo "*** CREATE ***" >> ../../${OUTPUT}
${JAVA} -jar -Xms${2} -Xmx${2} -Dlogback.configurationFile=${LOGFILE} ${1}.jar -w ${WARMUPS} -r ${ROUNDS} -o ../../${DATA_DIR}/${2}/${1}_create.data create >> ../../${OUTPUT}
restart_repository
echo "Batch create..."
echo "*** BATCH CREATE ***" >> ../../${OUTPUT}
${JAVA} -jar -Xms${2} -Xmx${2} -Dlogback.configurationFile=${LOGFILE} ${1}.jar -w ${WARMUPS} -r ${ROUNDS} -o ../../${DATA_DIR}/${2}/${1}_create-batch.data create-batch >> ../../${OUTPUT}
restart_repository
echo "Retrieve..."
echo "*** RETRIEVE ***" >> ../../${OUTPUT}
${JAVA} -jar -Xms${2} -Xmx${2} -Dlogback.configurationFile=${LOGFILE} ${1}.jar -w ${WARMUPS} -r ${ROUNDS} -o ../../${DATA_DIR}/${2}/${1}_retrieve.data retrieve >> ../../${OUTPUT}
restart_repository
echo "Retrieve all..."
echo "*** RETRIEVE ALL ***" >> ../../${OUTPUT}
${JAVA} -jar -Xms${2} -Xmx${2} -Dlogback.configurationFile=${LOGFILE} ${1}.jar -w ${WARMUPS} -r ${ROUNDS} -o ../../${DATA_DIR}/${2}/${1}_retrieve-all.data retrieve-all >> ../../${OUTPUT}
restart_repository
echo "Update..."
echo "*** UPDATE ***" >> ../../${OUTPUT}
${JAVA} -jar -Xms${2} -Xmx${2} -Dlogback.configurationFile=${LOGFILE} ${1}.jar -w ${WARMUPS} -r ${ROUNDS} -o ../../${DATA_DIR}/${2}/${1}_update.data update >> ../../${OUTPUT}
restart_repository
echo "Delete..."
echo "*** DELETE ***" >> ../../${OUTPUT}
${JAVA} -jar -Xms${2} -Xmx${2} -Dlogback.configurationFile=${LOGFILE} ${1}.jar -w ${WARMUPS} -r ${ROUNDS} -o ../../${DATA_DIR}/${2}/${1}_delete.data delete >> ../../${OUTPUT}
restart_repository
cd ../..
}
execute_round()
{
#AliBaba Benchmark
echo "Running AliBaba..."
echo "---------------------------------------" >> ${OUTPUT}
echo "| AliBaba |" >> ${OUTPUT}
echo "---------------------------------------" >> ${OUTPUT}
execute_with_provider "alibaba-benchmark" ${1}
#Empire Benchmark
echo "Running Empire..."
echo "---------------------------------------" >> ${OUTPUT}
echo "| Empire |" >> ${OUTPUT}
echo "---------------------------------------" >> ${OUTPUT}
execute_with_provider "empire-benchmark" ${1}
# JOPA Benchmark
echo "Running JOPA..."
echo "---------------------------------------" >> ${OUTPUT}
echo "| JOPA |" >> ${OUTPUT}
echo "---------------------------------------" >> ${OUTPUT}
execute_with_provider "jopa-benchmark" ${1}
# KOMMA Benchmark
echo "Running KOMMA..."
echo "---------------------------------------" >> ${OUTPUT}
echo "| KOMMA |" >> ${OUTPUT}
echo "---------------------------------------" >> ${OUTPUT}
execute_with_provider "komma-benchmark" ${1}
# RDFBeans Benchmark
echo "Running RDFBeans..."
echo "---------------------------------------" >> ${OUTPUT}
echo "| RDFBeans |" >> ${OUTPUT}
echo "---------------------------------------" >> ${OUTPUT}
execute_with_provider "rdfbeans-benchmark" ${1}
}
execute_benchmark()
{
start_repository
mkdir -p ${DATA_DIR}/${1}/
####
#
# Execute the whole benchmark several times, so that we have output from multiple JVM executions
#
####
for i in $(seq 1 ${EXECUTIONS})
do
echo "Running JVM round ${i}..."
execute_round ${1}
done
stop_repository
}
> ${OUTPUT}
echo "Running benchmark..."
for mem in "${MEMORY[@]}"
do
echo "Running benchmark with memory size ${mem}"
execute_benchmark ${mem}
done
echo "Benchmark finished."