Skip to content

Commit 8eb6e56

Browse files
committed
Add a python script which prints benchmarks results in a more readable way
1 parent 597da3c commit 8eb6e56

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

ppbenchmarks.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python3
2+
3+
import sys
4+
import re
5+
6+
benchmarks = dict()
7+
8+
for line in sys.stdin:
9+
line = line.rstrip()
10+
print(line)
11+
p = re.compile("Test Case '-\[BitByteDataBenchmarks\.(.+Benchmarks) (test.+)\]'.+average: (\d+.\d+), relative standard deviation: (\d+.\d+)\%")
12+
matches = p.findall(line)
13+
if len(matches) == 1 and len(matches[0]) == 4:
14+
benchmark_name = matches[0][0]
15+
test_name = matches[0][1]
16+
avg = matches[0][2]
17+
rel_std_dev = matches[0][3]
18+
benchmark = benchmarks.get(benchmark_name, list())
19+
benchmark.append(test_name + " " + avg + " " + rel_std_dev + "%")
20+
benchmarks[benchmark_name] = benchmark
21+
22+
for benchmark_name, results in benchmarks.items():
23+
print(benchmark_name + ":")
24+
for result in results:
25+
print(" " + result)
26+
print()

0 commit comments

Comments
 (0)