Skip to content

Commit 8a1cda0

Browse files
authored
Merge branch 'main' into longitudinal-plot-name
2 parents 1127321 + feeadc5 commit 8a1cda0

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ In `bench_runner.toml`, the `longitudinal_plot` table has a `subplots` key which
149149
- `base`: The base version to compare to. Should be a fully-specified version, e.g. "3.13.0".
150150
- `version`: The version series to use as a head. Should be a 2-part version, e.g. "3.14"
151151
- `flags`: (optional) A list of flags to match to for the head versions
152+
- `runners`: (optional) A list of nicknames of runners to plot. Defaults to all runners.
152153

153154
For example:
154155

@@ -157,7 +158,8 @@ For example:
157158
subplots = [
158159
{ base = "3.10.4", version = "3.11" },
159160
{ base = "3.12.0", version = "3.13" },
160-
{ base = "3.13.0", version = "3.14" },
161+
{ base = "3.13.0", version = "3.14", runners = ["linux1", "linux2"] },
162+
{ base = "3.13.0", version = "3.14", runners = ["windows1", "macos1"] },
161163
{ base = "3.13.0", version = "3.14", flags = ["JIT"] }
162164
]
163165
```
@@ -172,6 +174,7 @@ In `bench_runner.toml`, the `flag_effect_plot` table has a `subplots` key which
172174
- `version`: The version series to compare. Should be a 2-part version, e.g. "3.14"
173175
- `head_flags`: A list of flags to use as the head.
174176
- `base_flags`: (optional) A list of flags to use as the base. By default, this is a default build, i.e. no flags.
177+
- `runners`: (optional) A list of nicknames of runners to plot. Defaults to all runners.
175178
- `runner_map`: (optional) If you need to map a runner to a base in a
176179
different runner, you can provide that mapping here. For example, with
177180
tail-calling, you may want to compare runners configured to use clang
@@ -192,6 +195,7 @@ head_flags = ["JIT"]
192195
name = "Tail calling interpreter"
193196
version = "3.14"
194197
head_flags = ["TAILCALL"]
198+
runners = ["linux_clang"]
195199
runner_map = { linux_clang = "linux" }
196200
```
197201

bench_runner/plot.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def get_longitudinal_plot_config():
9393
assert "version" in subplot
9494
if "flags" not in subplot:
9595
subplot["flags"] = []
96+
subplot["runners"] = set(subplot.get("runners", ()))
9697

9798
return plots
9899

@@ -113,6 +114,7 @@ def get_flag_effect_plot_config():
113114
subplot["base_flags"] = []
114115
else:
115116
subplot["base_flags"] = sorted(set(subplot["base_flags"]))
117+
subplot["runners"] = set(subplot.get("runners", ()))
116118
if "runner_map" not in subplot:
117119
subplot["runner_map"] = {}
118120

@@ -329,6 +331,10 @@ def get_comparison_value(ref, r, base):
329331
ver_results = [
330332
r for r in results if list(r.parsed_version.release[0:2]) == version
331333
]
334+
if cfg["runners"]:
335+
cfg_runners = [r for r in runners if r.nickname in cfg["runners"]]
336+
else:
337+
cfg_runners = runners
332338

333339
if len(cfg["flags"]):
334340
titleflags = f" ({','.join(cfg['flags'])})"
@@ -339,7 +345,7 @@ def get_comparison_value(ref, r, base):
339345

340346
first_runner = True
341347

342-
for runner in runners:
348+
for runner in cfg_runners:
343349
runner_results = [
344350
r
345351
for r in ver_results
@@ -495,6 +501,8 @@ def get_comparison_value(ref, r, force_valid):
495501
)
496502

497503
for runner in mrunners.get_runners():
504+
if subplot["runners"] and runner.nickname not in subplot["runners"]:
505+
continue
498506
runner_is_mapped = runner.nickname in subplot["runner_map"]
499507
if subplot["runner_map"] and not runner_is_mapped:
500508
continue

tests/data/bench_runner.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ plot = { name = "Linux", color = "C0" }
1212
subplots = [
1313
{ base = "3.10.4", version = "3.11" },
1414
{ base = "3.12.0", version = "3.13" },
15-
{ base = "3.13.0b2", version = "3.14" },
15+
{ base = "3.13.0b2", version = "3.14", runners = ["linux"] },
1616
{ base = "3.13.0b2", version = "3.14", flags = ["JIT"] }
1717
]
1818

1919
[flag_effect_plot]
2020
subplots = [
2121
{ name = "JIT", version = "3.14", head_flags = ["JIT"] },
22+
{ name = "NOGIL", version = "3.14", head_flags = ["NOGIL"], runners = ["linux"] },
2223
]
2324

2425
[benchmark_longitudinal_plot]

0 commit comments

Comments
 (0)