From 644f75039a9ef4bf59e0ca633c9d59fd849c943a Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 30 May 2020 12:52:12 +0200 Subject: [benchmarks] reintroduce prepare Always running the possibly very expensive preparation code when a benchmark object is created is not reasonable when benchmarks should only be summarized. --- bench.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'bench.py') diff --git a/bench.py b/bench.py index adecc89..6a23cd0 100755 --- a/bench.py +++ b/bench.py @@ -181,14 +181,13 @@ def main(): print_error(f"Skipping {bench}! Loading failed.") continue - try: - print_status("Preparing", bench, "...") - bench = member() - break - except Exception: - print_error(traceback.format_exc()) - print_error(f"Skipping {bench}! Preparing failed.") - continue + try: + print_status("Preparing", bench, "...") + bench.prepare() + except Exception: + print_error(traceback.format_exc()) + print_error(f"Skipping {bench}! Preparing failed.") + continue if args.analyze: analyze_bench(bench) -- cgit v1.2.3