From 5e78c1ccda63bcbfd065f5dbde70f7e3ee1b881c Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 8 Sep 2018 15:51:20 +0200 Subject: measure wall time in falsesharing and fix summary for results with different args --- benchmark.py | 12 +++++++----- falsesharing.py | 16 +++++++++++----- loop.py | 4 ++-- mysql.py | 7 ++++--- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/benchmark.py b/benchmark.py index 920772f..caa25fd 100644 --- a/benchmark.py +++ b/benchmark.py @@ -93,15 +93,17 @@ class Benchmark (object): return True - def iterate_args(self): + def iterate_args(self, args=None): """Return a dict for each possible combination of args""" - arg_names = sorted(self.args.keys()) - for p in itertools.product(*[self.args[k] for k in arg_names]): + if not args: + args = self.args + arg_names = sorted(args.keys()) + for p in itertools.product(*[args[k] for k in arg_names]): Perm = namedtuple("Perm", arg_names) yield Perm(*p) - def iterate_args_fixed(self, fixed): - for p in self.iterate_args(): + def iterate_args_fixed(self, fixed, args=None): + for p in self.iterate_args(args=args): p_dict = p._asdict() is_fixed = True for k in fixed: diff --git a/falsesharing.py b/falsesharing.py index 7159e04..05a193e 100644 --- a/falsesharing.py +++ b/falsesharing.py @@ -9,6 +9,8 @@ import subprocess from benchmark import Benchmark +time_re = re.compile("^Time elapsed = (?P