Improves benchmarks

Make Virtuoso loading work
Allows to limit Rudf memory
Use bars for plot
pull/21/head
Tpt 5 years ago
parent f70478effd
commit f50589d8f2
  1. 18
      bench/bsbm-plot.py
  2. 10
      bench/bsbm_rudf.sh
  3. 9
      bench/bsbm_virtuoso.sh

@ -2,16 +2,20 @@ import xml.etree.ElementTree as ET
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from collections import defaultdict from collections import defaultdict
from glob import glob from glob import glob
from numpy import array
def plot_y_per_x_per_plot(data, xlabel, ylabel, file, log=False):
def plot_y_per_x_per_plot(data, xlabel, ylabel, file):
plt.figure(file) plt.figure(file)
for label, xys in data.items():
plt.plot(list(xys.keys()), list(xys.values()), '.', label=label) bar_width = 1 / (len(data) + 1)
for i, (label, xys) in enumerate(sorted(data.items())):
plt.bar(array(list(xys.keys())) + bar_width * (i + 1 - len(data) / 2), array(list(xys.values())), bar_width, label=label)
plt.legend() plt.legend()
plt.xlabel(xlabel) plt.xlabel(xlabel)
plt.ylabel(ylabel) plt.ylabel(ylabel)
# plt.yscale('log') if log:
plt.yscale('log')
plt.savefig(file) plt.savefig(file)
@ -23,7 +27,7 @@ for file in glob('bsbm.explore.*.xml'):
val = float(query.find('aqet').text) val = float(query.find('aqet').text)
if val > 0: if val > 0:
aqet[run][int(query.attrib['nr'])] = val aqet[run][int(query.attrib['nr'])] = val
plot_y_per_x_per_plot(aqet, 'query id', 'aqet', 'bsbm.explore.png') plot_y_per_x_per_plot(aqet, 'query id', 'execution time (s)', 'bsbm.explore.png')
# BSBM business intelligence # BSBM business intelligence
aqet = defaultdict(dict) aqet = defaultdict(dict)
@ -33,6 +37,6 @@ for file in glob('bsbm.businessIntelligence.*.xml'):
val = float(query.find('aqet').text) val = float(query.find('aqet').text)
if val > 0: if val > 0:
aqet[run][int(query.attrib['nr'])] = val aqet[run][int(query.attrib['nr'])] = val
plot_y_per_x_per_plot(aqet, 'query id', 'aqet', 'bsbm.businessIntelligence.png') plot_y_per_x_per_plot(aqet, 'query id', 'execution time (s) - log scale', 'bsbm.businessIntelligence.png', log=True)
plt.show() plt.show()

@ -1,14 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
DATASET_SIZE=100000 DATASET_SIZE=100000
MEMORY_SIZE=1000000
cd bsbm-tools cd bsbm-tools
./generate -fc -pc ${DATASET_SIZE} -s nt -fn "explore-${DATASET_SIZE}" ./generate -fc -pc ${DATASET_SIZE} -s nt -fn "explore-${DATASET_SIZE}"
cargo build --release --manifest-path="../../server/Cargo.toml" cargo build --release --manifest-path="../../server/Cargo.toml"
./../../target/release/rudf_server --file rudf_data & (
ulimit -d ${MEMORY_SIZE}
./../../target/release/rudf_server --file rudf_data
) &
sleep 5 sleep 5
curl -f -X POST -H 'Content-Type:application/n-triples' --data-binary "@explore-${DATASET_SIZE}.nt" http://localhost:7878/ curl -f -X POST -H 'Content-Type:application/n-triples' --data-binary "@explore-${DATASET_SIZE}.nt" http://localhost:7878/
./testdriver -ucf usecases/explore/sparql.txt -o "../bsbm.explore.rudf.${DATASET_SIZE}.$(date +'%Y-%m-%d').xml" http://localhost:7878/query ./testdriver -ucf usecases/explore/sparql.txt -o "../bsbm.explore.rudf.${DATASET_SIZE}.${MEMORY_SIZE}.$(date +'%Y-%m-%d').xml" http://localhost:7878/query
./testdriver -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.rudf.${DATASET_SIZE}.$(date +'%Y-%m-%d').xml" http://localhost:7878/query ./testdriver -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.rudf.${DATASET_SIZE}.${MEMORY_SIZE}.$(date +'%Y-%m-%d').xml" http://localhost:7878/query
kill $! kill $!
rm -r rudf_data rm -r rudf_data
rm "explore-${DATASET_SIZE}.nt" rm "explore-${DATASET_SIZE}.nt"

@ -6,9 +6,12 @@ cd bsbm-tools
cp ../virtuoso-opensource/database/virtuoso.ini.sample virtuoso.ini cp ../virtuoso-opensource/database/virtuoso.ini.sample virtuoso.ini
mkdir ../database mkdir ../database
../virtuoso-opensource/bin/virtuoso-t -f & ../virtuoso-opensource/bin/virtuoso-t -f &
sleep 30 sleep 10
curl -f --digest --user dba:dba -H 'Content-Type:application/n-triples' --data-binary "@explore-${DATASET_SIZE}.nt" 'http://localhost:8890/sparql-graph-crud-auth?graph-uri=urn:graph:test' ../virtuoso-opensource/bin/isql 1111 dba dba <<EOF
curl -f -H 'Content-Type:application/sparql-query' --data "SELECT (COUNT(*) AS ?c) WHERE { ?s ?p ?o }" 'http://localhost:8890/sparql?graph-uri=urn:graph:test' SPARQL CREATE GRAPH <urn:graph:test>;
ld_dir('$(realpath .)', 'explore-${DATASET_SIZE}.nt', 'urn:graph:test');
rdf_loader_run();
EOF
./testdriver -ucf usecases/explore/sparql.txt -o "../bsbm.explore.virtuoso.${DATASET_SIZE}.7.2.5.xml" 'http://localhost:8890/sparql?graph-uri=urn:graph:test' ./testdriver -ucf usecases/explore/sparql.txt -o "../bsbm.explore.virtuoso.${DATASET_SIZE}.7.2.5.xml" 'http://localhost:8890/sparql?graph-uri=urn:graph:test'
./testdriver -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.virtuoso.${DATASET_SIZE}.7.2.5.xml" 'http://localhost:8890/sparql?graph-uri=urn:graph:test' ./testdriver -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.virtuoso.${DATASET_SIZE}.7.2.5.xml" 'http://localhost:8890/sparql?graph-uri=urn:graph:test'
kill $! kill $!

Loading…
Cancel
Save