Skip to content

Commit 20a3ad1

Browse files
committed
Fix #422: Don't hardcode 4th plot as JIT
1 parent 5acdb47 commit 20a3ad1

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,21 @@ flags = ["TAILCALL"]
8383
runners = ["linux_clang", "darwin", "windows_clang"]
8484
```
8585

86+
### Configurable flags in longitudinal plots
87+
88+
The flags to use for each of the longitudinal plots is now configurable. (Previously, the fourth one was always for JIT).
89+
90+
The plot configuration, for example, will create two plots. The first will
91+
compare default builds on the 3.14 branch against 3.13.0. The second will
92+
compare JIT builds on the 3.14 branch against 3.13.0.
93+
94+
```
95+
[plot]
96+
bases = ["3.13.0", "3.13.0"]
97+
versions = [[3, 14], [3, 14]]
98+
flags = [[], ["JIT"]]
99+
```
100+
86101
### Long-running tests
87102

88103
`bench-runner` has some new long-running end-to-end integration tests. To avoid running them, use:

bench_runner/plot.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ def get_plot_config():
8989
== len(content["markers"])
9090
)
9191

92+
if "flags" not in content:
93+
content["flags"] = [[]] * len(content["bases"])
94+
9295
return content
9396

9497

@@ -276,8 +279,8 @@ def get_comparison_value(ref, r, base):
276279
]
277280

278281
subtitle = f"Python {version_str}.x vs. {base}"
279-
if i == 3:
280-
subtitle += " (with JIT)"
282+
if len(cfg["flags"][i]):
283+
subtitle += f" ({','.join(cfg['flags'][i])})"
281284
ax.set_title(subtitle)
282285

283286
for runner_i, (runner, name, color, style, marker) in enumerate(
@@ -289,13 +292,11 @@ def get_comparison_value(ref, r, base):
289292
cfg["markers"],
290293
)
291294
):
292-
runner_results = [r for r in ver_results if r.nickname == runner]
293-
294-
# The last plot is JIT-only
295-
if i == 3:
296-
runner_results = [r for r in runner_results if r.flags == ["JIT"]]
297-
else:
298-
runner_results = [r for r in runner_results if r.flags == []]
295+
runner_results = [
296+
r
297+
for r in ver_results
298+
if r.nickname == runner and set(r.flags) == set(cfg["flags"][i])
299+
]
299300

300301
for r in results:
301302
if r.nickname == runner and r.version == base and r.flags == []:

bench_runner/templates/bench_runner.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ env.BUILD_DEST = "PCbuild/amd64"
5959
[plot]
6060
bases = ["3.11.0"]
6161
versions = [[3, 12]]
62+
# The flags to use for each of the versions. The base is always "default" (without flags)
63+
flags = [[]]
6264
runners = ["linux"]
6365
names = ["linux"]
6466
colors = ["C0"]

0 commit comments

Comments
 (0)