From 25c4d81069f576354d0279bf38417c236e924540 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 25 Mar 2019 17:49:39 +0100 Subject: move benchmark definitions into src/benchmarks bench now loads all *.py files from src/benchmarks as benchmarks --- bench.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bench.py') diff --git a/bench.py b/bench.py index 412597f..90bd0bf 100755 --- a/bench.py +++ b/bench.py @@ -14,7 +14,9 @@ import src.globalvars from src.util import * -benchmarks = ["loop", "mysql", "falsesharing", "dj_trace", "larson"] +bench_dir = "src/benchmarks" +benchmarks = [e[:-3] for e in os.listdir(bench_dir) + if e[-3:] == ".py" and e != "__init__.py"] parser = argparse.ArgumentParser(description="benchmark memory allocators") parser.add_argument("-ds, --dont-save", action='store_true', dest="dont_save", @@ -143,7 +145,7 @@ def main(): continue try: - bench = eval("importlib.import_module('src.{0}').{0}".format(bench)) + bench = eval("importlib.import_module('src.benchmarks.{0}').{0}".format(bench)) if args.load: bench.load(path=args.load) -- cgit v1.2.3