diff options
author | David Robillard <d@drobilla.net> | 2021-10-21 15:38:10 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-28 21:57:07 -0500 |
commit | b404312686874e539b617d1f27ccbaa5a82936af (patch) | |
tree | c2fdb2cc046e6da53071629cd1750dcc327e6cd9 /scripts | |
parent | d4aec28ba8ad24d5aef3ee12beeb1b805148eab1 (diff) | |
download | serd-b404312686874e539b617d1f27ccbaa5a82936af.tar.gz serd-b404312686874e539b617d1f27ccbaa5a82936af.tar.bz2 serd-b404312686874e539b617d1f27ccbaa5a82936af.zip |
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.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/serd_bench.py | 24 |
1 files changed, 12 insertions, 12 deletions
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) |