Skip to content

Commit 087b16c

Browse files
authored
Merge pull request #373 from faster-cpython/link-to-latest-tier1-stats
Link to latest Tier1 and JIT stats
2 parents 194b390 + dc7d55c commit 087b16c

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

Diff for: bench_runner/scripts/generate_results.py

+25-18
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,26 @@ def summarize_results(
170170
return new_results
171171

172172

173-
def get_most_recent_pystats(results: Iterable[Result]) -> Result | None:
174-
candidate_pystats = [
175-
result
176-
for result in results
177-
if result.result_info == ("pystats raw", None, None)
178-
and result.fork == "python"
179-
and result.flags in (["PYTHON_UOPS"], ["JIT"])
180-
]
181-
if len(candidate_pystats):
182-
return sorted(
183-
candidate_pystats,
184-
key=lambda x: (x.parsed_version, x.commit_datetime),
185-
reverse=True,
186-
)[0]
173+
def get_most_recent_pystats(
174+
results: Iterable[Result],
175+
) -> Iterable[tuple[list[str], Result]]:
176+
for flags in ([], ["PYTHON_UOPS"], ["JIT"]):
177+
candidate_pystats = [
178+
result
179+
for result in results
180+
if result.result_info == ("pystats raw", None, None)
181+
and result.fork == "python"
182+
and result.flags == flags
183+
]
184+
if len(candidate_pystats):
185+
yield (
186+
flags,
187+
sorted(
188+
candidate_pystats,
189+
key=lambda x: (x.parsed_version, x.commit_datetime),
190+
reverse=True,
191+
)[0],
192+
)
187193

188194

189195
def generate_index(
@@ -198,13 +204,14 @@ def generate_index(
198204
"""
199205
content = io.StringIO()
200206

201-
if (most_recent_pystats := get_most_recent_pystats(all_results)) is not None:
207+
for flags, result in get_most_recent_pystats(all_results):
202208
link = table.md_link(
203-
f"Most recent pystats on main ({most_recent_pystats.cpython_hash})",
204-
str(util.apply_suffix(most_recent_pystats.filename, ".md")),
209+
f"Most recent {','.join(flags)} pystats on main ({result.cpython_hash})",
210+
str(util.apply_suffix(result.filename, ".md")),
205211
filename,
206212
)
207-
content.write(f"{link}\n\n")
213+
content.write(f"- {link}\n")
214+
content.write("\n")
208215

209216
for runner, results in results_by_runner(benchmarking_results):
210217
content.write(f"## {runner}\n")

0 commit comments

Comments
 (0)