From b404312686874e539b617d1f27ccbaa5a82936af Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 21 Oct 2021 15:38:10 -0400 Subject: Replace serdi with more fine-grained tools Especially with the new functionality, the complexity of the command-line interface alone was really becoming unmanageable. The serdi implementation also had the highest cyclomatic complexity of the entire codebase by a huge margin. So, take a page from the Unix philosophy and split serdi into several more finely-honed tools that can be freely composed. Though there is still unfortunately quite a bit of option overlap between them due to the common details of reading RDF, I think the resulting tools are a lot easier to understand, both from a user and a developer perspective. --- scripts/serd_bench.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'scripts/serd_bench.py') diff --git a/scripts/serd_bench.py b/scripts/serd_bench.py index 8a10dab0..25b75fe8 100755 --- a/scripts/serd_bench.py +++ b/scripts/serd_bench.py @@ -43,7 +43,7 @@ def gen(sp2b_dir, n_min, n_max, step): def write_header(results, progs): "Write the header line for TSV output" - results.write("n\tserdi_stream\tserdi_model") + results.write("n\tserd-pipe\tserd-sort") for prog in progs[2:]: results.write("\t" + os.path.basename(prog.split()[0])) results.write("\n") @@ -125,9 +125,9 @@ def run(progs, n_min, n_max, step): "Benchmark each program with n_min ... n_max statements" with WorkingDirectory("build"): results = { - "time": open("serdi-time.txt", "w"), - "throughput": open("serdi-throughput.txt", "w"), - "memory": open("serdi-memory.txt", "w"), + "time": open("serd-time.txt", "w"), + "throughput": open("serd-throughput.txt", "w"), + "memory": open("serd-memory.txt", "w"), } # Write TSV header for all output files @@ -169,20 +169,20 @@ def plot_results(): "Plot all benchmark results" with WorkingDirectory("build"): plot( - open("serdi-time.txt", "r"), - "serdi-time.svg", + open("serd-time.txt", "r"), + "serd-time.svg", "Statements", "Time (s)", ) plot( - open("serdi-throughput.txt", "r"), - "serdi-throughput.svg", + open("serd-throughput.txt", "r"), + "serd-throughput.svg", "Statements", "Statements / s", ) plot( - open("serdi-memory.txt", "r"), - "serdi-memory.svg", + open("serd-memory.txt", "r"), + "serd-memory.svg", "Statements", "Bytes", ) @@ -226,8 +226,8 @@ example: args = ap.parse_args(sys.argv[1:]) progs = [ - "serdi -i turtle -o turtle", - "serdi -m -i turtle -o turtle", + "serd-pipe -I turtle -O turtle", + "serd-sort -I turtle -O turtle", ] + args.run min_n = int(args.max / 10) -- cgit v1.2.1