summaryrefslogtreecommitdiffstats
path: root/parse_res.py
blob: eea29722790dd89f08d68888b0b3700bd20de642 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from pprint import pprint
import statistics

def main():
    results = {}
    with open("results") as f:
        for line in f.readlines():
            (function, input_file, time) = line.split(" ")

            if input_file not in results:
                results[input_file] = {}

            if function not in results[input_file]:
                results[input_file][function] = []

            results[input_file][function].append(float(time.split("PT")[1].split("S")[0]))

    for input_file in sorted(results.keys()):
        for function in sorted(results[input_file].keys()):
            line = results[input_file][function]

            print("{} {}:\n  mean: {}\n  stdev: {}\n"
                    .format(function, input_file,
                            statistics.mean(line),
                            statistics.pstdev(line)))

main()