Skip to content

Commit

Permalink
Report total runtime in PR benchmark comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jprider63 committed Sep 9, 2024
1 parent 90c1468 commit ecd2906
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/compare-benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@ def main():

missing = set()
degradation = set()
baseline_total = 0
new_total = 0

output = []
for benchmark in baseline:
name = benchmark['name']
baseline_value = benchmark['value']
baseline_total += baseline_value

new_value_m = new_numbers.get(name)
if new_value_m:
new_total += new_value_m
(diff, percentage) = to_diff(new_value_m, baseline_value)

if percentage > THRESHOLD:
Expand All @@ -55,6 +59,15 @@ def main():
else:
missing.add(name)

for name in new_numbers:
new_value = new_numbers[name]
output.append([name, "-", new_value, "-"])

new_total += new_value

(total_diff, _) = to_diff(new_total, baseline_total)
output.append(["**Total runtime**", baseline_total, new_total, total_diff])

print("")
if len(degradation) != 0:
print("**Warning**: Performance degradations: " + ', '.join(degradation))
Expand Down

0 comments on commit ecd2906

Please sign in to comment.