aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-09-30 13:23:52 +0200
committerDavid Robillard <d@drobilla.net>2021-03-08 23:34:56 -0500
commitec0edd399d3ef493c4ddb0e821a56b53a19dbc96 (patch)
tree155dd5a0f64874e06c87333383d8697f8a12dfbd
parent677d85c7f3df3563e990f41964f6ae7d560567a0 (diff)
downloadserd-ec0edd399d3ef493c4ddb0e821a56b53a19dbc96.tar.gz
serd-ec0edd399d3ef493c4ddb0e821a56b53a19dbc96.tar.bz2
serd-ec0edd399d3ef493c4ddb0e821a56b53a19dbc96.zip
Add model to benchmarks
-rwxr-xr-xscripts/serd_bench.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/serd_bench.py b/scripts/serd_bench.py
index e6f12cc8..e4adb0ec 100755
--- a/scripts/serd_bench.py
+++ b/scripts/serd_bench.py
@@ -43,8 +43,8 @@ def gen(sp2b_dir, n_min, n_max, step):
def write_header(results, progs):
"Write the header line for TSV output"
- results.write("n")
- for prog in progs:
+ results.write('n\tserdi_stream\tserdi_model')
+ for prog in progs[2:]:
results.write("\t" + os.path.basename(prog.split()[0]))
results.write("\n")
@@ -151,7 +151,7 @@ def run(progs, n_min, n_max, step):
time, memory = parse_time(proc.communicate()[1].decode())
rows["time"] += ["%.07f" % time]
- rows["throughput"] += ["%d" % (n / time)]
+ rows["throughput"] += ["%d" % (n / time)] if time > 0.0 else 0
rows["memory"] += [str(memory)]
# Write rows to output files
@@ -223,7 +223,9 @@ example:
args = ap.parse_args(sys.argv[1:])
- progs = ["serdi -b -f -i turtle -o turtle"] + args.run
+ progs = ['serdi -b -i turtle -o turtle',
+ 'serdi -m -b -i turtle -o turtle'] + args.run
+
min_n = int(args.max / 10)
max_n = args.max
step = min_n