Skip to content

Commit aa2ac8c

Browse files
authored
Merge pull request #425 from mdboom/simplify-plot-config
Simplify plot config
2 parents 5acdb47 + 87533f4 commit aa2ac8c

File tree

6 files changed

+221
-129
lines changed

6 files changed

+221
-129
lines changed

CHANGELOG.md

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

86+
### New plot configuration
87+
88+
The plot configuration has been completely overhauled.
89+
90+
If you have a `[plot]` section in `bench_runner.toml` it should be removed.
91+
Runner-specific plot configuration is now in the `plot` key in each runner table.
92+
Configuration of the longitudinal and flag effect plots are in the new `[longitudinal_plot]` and `[flag_effect_plot]` sections.
93+
See `README.md` for more information.
94+
8695
### Long-running tests
8796

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

README.md

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,64 @@ To do so, add a symlink called `loops.json` to the root of your repository that
127127
ln -s results/bm-20231002-3.12.0-0fb18b0/bm-20231002-linux-x86_64-python-v3.12.0-3.12.0-0fb18b0.json loops.json
128128
```
129129

130-
#### Longitudinal plots
130+
#### Plot configuration
131131

132-
The longitudinal plots are configured in the `plot` section of `bench_runner.toml`.
132+
`bench_runner` will produce longitudinal plots comparing versions in a series to a specific base version, as well as showing the effect of various flags on the same commits over time.
133133

134-
**TODO: Describe this in more detail**
134+
##### Runner plot styles
135+
136+
For each runner in your `bench_runner.toml`, you can specify a `plot` table with the following keys to control how that runner is rendered in the longitudinal plots:
137+
138+
- `name`: A human-friendly name to display in the plot legend
139+
- `style`: A [matplotlib line style](https://matplotlib.org/stable/api/_as_gen/matplotlib.lines.Line2D.html#matplotlib.lines.Line2D.set_linestyle)
140+
- `marker`: A [matplotlib marker](https://matplotlib.org/stable/api/markers_api.html#module-matplotlib.markers)
141+
- `color`: A [matplotlib color](https://matplotlib.org/stable/users/explain/colors/colors.html#colors-def)
142+
143+
#### Longitudinal plot configuration
144+
145+
The longitudinal plot shows the change of a version branch over time against a specified base version. It is made up of multiple subplots, each with its own head and base, and optionally configuration flags.
146+
147+
In `bench_runner.toml`, the `longitudinal_plot` table has a `subplots` key which is an array of tables with the following keys:
148+
149+
- `base`: The base version to compare to. Should be a fully-specified version, e.g. "3.13.0".
150+
- `version`: The version series to use as a head. Should be a 2-part version, e.g. "3.14"
151+
- `flags`: (optional) A list of flags to match to for the head versions
152+
153+
For example:
154+
155+
```toml
156+
[longitudinal_plot]
157+
subplots = [
158+
{ base = "3.10.4", version = "3.11" },
159+
{ base = "3.12.0", version = "3.13" },
160+
{ base = "3.13.0", version = "3.14" },
161+
{ base = "3.13.0", version = "3.14", flags = ["JIT"] }
162+
]
163+
```
164+
165+
#### Flag effect plot configuration
166+
167+
The flag effect plot shows the effect of specified configuration flags against a base with the same commit hash, but different configuration flags.
168+
169+
In `bench_runner.toml`, the `flag_effect_plot` table has a `subplots` key which is an array of tables with the following keys:
170+
171+
- `name`: The description of the flags to use in the title.
172+
- `head_flags`: A list of flags to use as the head.
173+
- `base_flags`: (optional) A list of flags to use as the base. By default, this is a default build, i.e. no flags.
174+
- `runner_map`: (optional) If you need to map a runner to a base in a different runner, you can provide that mapping here. For example, with tail-calling, you may want to compare runners configured to use clang against runners configured with the "default compiler" for a given platform. The mapping is from the "head" runner nickname to the "base" runner nickname.
175+
176+
For example:
177+
178+
```toml
179+
[[flag_effect_plot.subplots]]
180+
name = "JIT"
181+
head_flags = ["JIT"]
182+
183+
[[flag_effect_plot.subplots]]
184+
name = "Tail calling interpreter"
185+
head_flags = ["TAILCALL"]
186+
runner_map = { linux_clang = "linux" }
187+
```
135188

136189
#### Purging old data
137190

0 commit comments

Comments
 (0)