From b82099483c78acf8245a1c6be94b546b64d483d8 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 14 Sep 2018 20:21:56 +0200 Subject: fix perf parsing and add new plot functions and use them --- larson.py | 38 ++++++-------------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) (limited to 'larson.py') diff --git a/larson.py b/larson.py index d7d1033..728401b 100644 --- a/larson.py +++ b/larson.py @@ -1,7 +1,4 @@ -import matplotlib.pyplot as plt import multiprocessing -import numpy as np -import os import re from benchmark import Benchmark @@ -32,35 +29,12 @@ class Benchmark_Larson( Benchmark ): if res: result["throughput"] = int(res.group("throughput")) return - print(stdout) - print("no match") - - def summary(self, sd=None): - # Speedup thrash - args = self.results["args"] - nthreads = args["threads"] - targets = self.results["targets"] - - sd = sd or "" - - for arg in args: - loose_arg = [a for a in args if a != arg][0] - for arg_value in args[arg]: - for target in targets: - y_vals = [] - for perm in self.iterate_args_fixed({arg : arg_value}, args=args): - d = [m["throughput"] for m in self.results[target][perm]] - y_vals.append(np.mean(d)) - x_vals = list(range(1, len(y_vals) + 1)) - plt.plot(x_vals, y_vals, marker='.', linestyle='-', - label=target, color=targets[target]["color"]) - plt.legend() - plt.xticks(x_vals, args[loose_arg]) - plt.xlabel(loose_arg) - plt.ylabel("OPS/s") - plt.title("Larson: " + arg + " " + str(arg_value)) - plt.savefig(os.path.join(sd, ".".join([self.name, arg, str(arg_value), "png"]))) - plt.clf() + def summary(self, sumdir): + # Plot threads->throughput and maxsize->throughput + self.plot_fixed_args("{throughput}", + ylabel="'OPS/s'", + title = "'Larson: ' + arg + ' ' + str(arg_value)", + sumdir=sumdir) larson = Benchmark_Larson() -- cgit v1.2.3