diff --git a/benchmarks/scripts/analyze.py b/benchmarks/scripts/analyze.py index 486b31499..ba1dd03cf 100755 --- a/benchmarks/scripts/analyze.py +++ b/benchmarks/scripts/analyze.py @@ -192,6 +192,17 @@ def coverage(args): iterate_case_dfs(args, case_coverage) +def case_variants(pattern, algname, ct_point_name, case_df): + print("{}[{}]:".format(algname, ct_point_name)) + mask = case_df['variant'].str.contains(pattern, regex=True) + print(case_df[mask][['variant', 'speedup'] + get_rt_axes(case_df)]) + + +def variants(args): + pattern = re.compile(args.variants) + iterate_case_dfs(args, functools.partial(case_variants, pattern)) + + def parse_arguments(): parser = argparse.ArgumentParser( description="Analyze benchmark results.") @@ -203,6 +214,8 @@ def parse_arguments(): '--coverage', action=argparse.BooleanOptionalAction, help="Show variant space coverage.") parser.add_argument( '--top', default=7, type=int, action='store', nargs='?', help="Show top N variants with highest score.") + parser.add_argument( + '--variants', type=str, help="Show matching variants data.") return parser.parse_args() @@ -219,6 +232,10 @@ def main(): if args.coverage: coverage(args) return + + if args.variants: + variants(args) + return top(args)