diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-04-10 13:23:46 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-04-10 13:23:46 +0200 |
| commit | acda99ce26d3b7ee04b346b9e59ff208c9ae0419 (patch) | |
| tree | 8ea92705be53eadba450bce40065f403dc7d0b24 | |
| parent | c00983486fb46c2514b0d783a44e762afc347067 (diff) | |
| download | allocbench-acda99ce26d3b7ee04b346b9e59ff208c9ae0419.tar.gz allocbench-acda99ce26d3b7ee04b346b9e59ff208c9ae0419.zip | |
add normalization to plot_fixed_arg
| -rw-r--r-- | src/benchmark.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/benchmark.py b/src/benchmark.py index 20c2ca0..a83c3ac 100644 --- a/src/benchmark.py +++ b/src/benchmark.py @@ -350,7 +350,7 @@ class Benchmark (object): def plot_fixed_arg(self, yval, ylabel="'y-label'", xlabel="loose_arg", autoticks=True, title="'default title'", filepostfix="", - sumdir="", fixed=[], file_ext="png"): + sumdir="", fixed=[], file_ext="png", scale=None): args = self.results["args"] allocators = self.results["allocators"] @@ -367,7 +367,15 @@ class Benchmark (object): for allocator in allocators: y_vals = [] for perm in self.iterate_args_fixed({arg: arg_value}, args=args): - y_vals.append(eval(yval.format(**self.results["mean"][allocator][perm]))) + if scale: + if scale == allocator: + y_vals = [1] * len(x_vals) + else: + mean = eval(yval.format(**self.results["mean"][allocator][perm])) + norm_mean = eval(yval.format(**self.results["mean"][scale][perm])) + y_vals.append(mean / norm_mean) + else: + y_vals.append(eval(yval.format(**self.results["mean"][allocator][perm]))) plt.plot(x_vals, y_vals, marker='.', linestyle='-', |
