Skip to content

Commit 9058ee6

Browse files
Improve genreport
1 parent 7b1ac61 commit 9058ee6

File tree

2 files changed

+6
-38
lines changed

2 files changed

+6
-38
lines changed

perf/genreport.py

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import os
1010
import subprocess
1111

12-
import matplotlib.pyplot as plt
1312
import pandas as pd
1413

1514

@@ -64,14 +63,16 @@ def create_comparison_table(results):
6463
for result in results:
6564
commit = result.get("git_info", {}).get("commit_hash", "unknown")[:8]
6665
date = result.get("git_info", {}).get("commit_date", "unknown")
67-
66+
system_info = result["system_info"]
67+
python_version = system_info["python_version"]
68+
python_implementation = system_info.get("python_implementation", "")
69+
if python_implementation:
70+
python_version = python_version + " " + python_implementation
6871
row = {
6972
"timestamp": result.get("timestamp", "unknown"),
7073
"commit": _try_get_git_tag(commit),
7174
"date": date,
72-
"python_version": result.get("system_info", {}).get(
73-
"python_version", "unknown"
74-
),
75+
"python_version": python_version,
7576
"platform": result.get("system_info", {}).get("platform", "unknown"),
7677
"branch": result.get("git_info", {}).get("branch", "unknown"),
7778
}
@@ -124,38 +125,6 @@ def _aggregate(df: pd.DataFrame, by: str):
124125
return aggregated_df
125126

126127

127-
def plot_performance_trends(df, output_file="performance_trends.png"):
128-
"""Create a plot showing performance trends"""
129-
plt.figure(figsize=(12, 8))
130-
131-
# Plot time metrics
132-
time_cols = [col for col in df.columns if col.endswith("_avg_ms")]
133-
for col in time_cols:
134-
plt.subplot(2, 1, 1)
135-
plt.plot(df["date"], df[col], marker="o", label=col)
136-
137-
plt.title("Performance Trends Across Commits")
138-
plt.ylabel("Time (ms)")
139-
plt.xticks(rotation=45)
140-
plt.legend()
141-
plt.grid(True)
142-
143-
# Plot memory metrics
144-
mem_cols = [col for col in df.columns if col.endswith("_peak_mb")]
145-
for col in mem_cols:
146-
plt.subplot(2, 1, 2)
147-
plt.plot(df["date"], df[col], marker="s", label=col)
148-
149-
plt.ylabel("Memory (MB)")
150-
plt.xticks(rotation=45)
151-
plt.legend()
152-
plt.grid(True)
153-
154-
plt.tight_layout()
155-
plt.savefig(output_file)
156-
print(f"Plot saved to {output_file}")
157-
158-
159128
def _set_conditional_formatting(df, worksheet, max_row):
160129
all_cols = [
161130
col for col in df.columns if col.endswith("_avg_ms") or col.endswith("_peak_mb")

perf/req.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
matplotlib==3.10.1
21
memory-profiler==0.61.0
32
pandas==2.2.3
43
psutil==7.0.0

0 commit comments

Comments
 (0)