Skip to content

Commit

Permalink
try to adapt python
Browse files Browse the repository at this point in the history
  • Loading branch information
victimsnino committed Nov 22, 2024
1 parent 97eaa36 commit 3da117e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ci/process_benchmark_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,8 +51,8 @@ def print_metric(v):
print(f"<details>\n<summary>\n\n## {platform}\n</summary>")
for title, title_data in group_by(platformResults, lambda x:x["title"]):
print(f"<details>\n<summary>\n\n### {title} \n</summary>\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:]

Expand All @@ -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</details>")
print(f"</details>")

Expand Down

0 comments on commit 3da117e

Please sign in to comment.