diff --git a/ci/process_benchmark_data.py b/ci/process_benchmark_data.py index bdce0dc4f..1b95583a3 100644 --- a/ci/process_benchmark_data.py +++ b/ci/process_benchmark_data.py @@ -29,7 +29,13 @@ def print_metric(v): print("# BENCHMARK RESULTS (AUTOGENERATED)") +optimization_off_suffix = " (Optimizations disabled)" +optimization_off_title = f"rpp{optimization_off_suffix}" for platform, results in new_data.items(): + is_optimization = platform.endswith(optimization_off_suffix) + if is_optimization: + platform = platform[:-len(optimization_off_suffix)] + results = [{**r, "source": optimization_off_title} for r in results if r["source"] == 'rpp'] for r in results: r["commit"] = git_commit r["commit_message"] = commit_message @@ -45,8 +51,8 @@ def print_metric(v): print(f"
\n\n\n## {platform}\n") for title, title_data in group_by(platformResults, lambda x:x["title"]): print(f"
\n\n\n### {title} \n\n\n") - print("name | rxcpp | rpp | prev rpp | ratio") - print("--- | --- | --- | --- | --- ") + print("name | rxcpp | rpp | prev rpp | ratio | rpp no optimization") + print("--- | --- | --- | --- | --- | ---") for name, name_data in group_by(title_data, lambda x: x["name"]): last_2_commits = [list(v) for _, v in group_by(name_data, lambda x: x["commit"])][-2:] @@ -57,12 +63,13 @@ def print_metric(v): cur_vals = {k: list(v)[0] for k, v in group_by(last_2_commits[-1], lambda x: x["source"])} rpp_value = cur_vals.get('rpp', {}).get('median(elapsed)') rxcpp_value = cur_vals.get('rxcpp', {}).get('median(elapsed)') + no_optimization_value = cur_vals.get(optimization_off_title, {}).get('median(elapsed)') ratio = None if prev_value and rpp_value: ratio = rpp_value/prev_value - print(f"{name} | {print_metric(rxcpp_value)} | {print_metric(rpp_value)}| {print_metric(prev_value)} | {ratio if ratio else 0:.2f}") + print(f"{name} | {print_metric(rxcpp_value)} | {print_metric(rpp_value)}| {print_metric(prev_value)} | {ratio if ratio else 0:.2f} | {print_metric(no_optimization_value)}") print("\n
") print(f"
")