diff --git a/benches/marshal_bench.rs b/benches/marshal_bench.rs index 0bd5526..00cd967 100644 --- a/benches/marshal_bench.rs +++ b/benches/marshal_bench.rs @@ -379,7 +379,7 @@ fn criterion_benchmark(c: &mut Criterion) { make_dbus_bytestream_message(&parts, false); }) }); - c.bench_function("marshal_dbus_message_parser", |b| { + c.bench_function("marshal_dbus_msg_parser", |b| { b.iter(|| { make_dbus_message_parser_message(&parts, false); }) diff --git a/tools/make_table.py b/tools/make_table.py new file mode 100755 index 0000000..4d03d2e --- /dev/null +++ b/tools/make_table.py @@ -0,0 +1,57 @@ +#! /bin/python3 + +import os + +stream = os.popen('bash -c "cargo bench | grep time"') +#stream = os.popen('bash -c "cargo bench rustbus | grep time"') +output = stream.read() + +table_lines = [] +results = {} +benches = [] + +def filter_empty(var): + return len(var) != 0 + +lines = output.split("\n") +for line in lines: + if len(line) == 0: + continue + + words = line.split(" ") + words = list(filter(filter_empty, words)) + + name_split = words[0].split("_") + benchname = name_split[0] + libname = "_".join(name_split[1:]) + timings = " ".join(words[2:]) + + if not benchname in benches: + benches.append(benchname) + + if not libname in results: + results[libname] = {} + results[libname][benchname] = timings + +for libname in results: + print(libname) + line = "|" + libname + "|" + for bench in benches: + libbenches = results[libname] + if bench in libbenches: + line += libbenches[bench] + line += "|" + + table_lines.append(line) + +header = "|Library|" +for bench in benches: + header += bench + "|" +print(header) +header = "|-|" +for bench in benches: + header += "-|" +print(header) + +for line in table_lines: + print(line) \ No newline at end of file