diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2018-07-20 14:17:04 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2018-07-20 14:17:04 +0200 |
| commit | 78098dbe189ae84b38cf6c94cbe06dafd07cb10c (patch) | |
| tree | a637cc1cc44dd3f0ddce3a47e9887bb546774adb /bench.py | |
| parent | 08cdc1d18cd8371b38ef1a6bf663ca32bb951c9e (diff) | |
| download | allocbench-78098dbe189ae84b38cf6c94cbe06dafd07cb10c.tar.gz allocbench-78098dbe189ae84b38cf6c94cbe06dafd07cb10c.zip | |
make results independant and add cmdline options
Diffstat (limited to 'bench.py')
| -rwxr-xr-x | bench.py | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -1,21 +1,41 @@ #!/usr/bin/env python3 +import argparse + from bench_loop import loop from bench_conprod import conprod from bench_mysql import mysql +parser = argparse.ArgumentParser(description="benchmark memory allocators") +parser.add_argument("-s", "--save", help="save benchmark results to disk", action='store_true') +parser.add_argument("-l", "--load", help="load benchmark results from disk", action='store_true') +parser.add_argument("-r", "--runs", help="how often the benchmarks run", default=3) + + benchmarks = [loop, conprod, mysql] def main(): + args = parser.parse_args() + print (args) + for bench in benchmarks: + if args.load: + bench.load() + print("Preparing", bench.name) if not bench.prepare(): continue + print("Running", bench.name) - if not bench.run(runs=1): + if not bench.run(runs=args.runs): continue + + if args.save: + bench.save() + print("Summarizing", bench.name) bench.summary() + if hasattr(bench, "cleanup"): print("Cleaning after", bench.name) bench.cleanup() |
