Add benchmarks comparison job

This commit is contained in:
Siarhei Fedartsou 2024-05-11 20:23:41 +02:00
parent ffe6f17380
commit 36cddba728
2 changed files with 4 additions and 4 deletions

View File

@ -658,10 +658,6 @@ jobs:
- name: Run Benchmarks
run: |
./pr/scripts/ci/run_benchmarks.sh base pr
- name: Compare Benchmarks
run: |
cat pr_results/match_mld.bench
cat base_results/match_mld.bench
- name: Post Benchmark Results
run: |
python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results

View File

@ -36,6 +36,7 @@ def collect_benchmark_results(base_folder, pr_folder):
results_index = {}
for file in os.listdir(base_folder):
print('base file:', file)
if not file.endswith('.bench'): continue
with open(f"{base_folder}/{file}") as f:
result = f.read().strip()
@ -43,6 +44,7 @@ def collect_benchmark_results(base_folder, pr_folder):
results_index[file] = len(results) - 1
for file in os.listdir(pr_folder):
print('pr file:', file)
if not file.endswith('.bench'): continue
with open(f"{pr_folder}/{file}") as f:
result = f.read().strip()
@ -51,6 +53,8 @@ def collect_benchmark_results(base_folder, pr_folder):
else:
results.append({'base': None, 'pr': result, 'name': os.path.splitext(file)[0]})
return results
def main():
if len(sys.argv) != 3:
print("Usage: python post_benchmark_results.py <base_folder> <pr_folder>")