@@ -246,3 +246,51 @@ Rust code being written today.
246
246
- Compare the benchmarking time of the two versions.
247
247
- When adding the new version, for `perf-config.json` and the `N-*.patch`
248
248
files, use the corresponding files for the old version as a starting point.
249
+
250
+ # Benchmark update policy
251
+
252
+ rustc-perf is a "living benchmark suite" that is regularly changed. Some
253
+ benchmarks in rustc-perf are verbatim copies of third-party crates. We
254
+ periodically do a mass update of these benchmarks.
255
+
256
+ Benefits of this approach:
257
+ - We ensure we are measuring compilation of the crates most people are using.
258
+ This is most relevant for popular crates.
259
+ - We get coverage of newer language features.
260
+
261
+ Costs of this approach:
262
+ - It takes time and effort.
263
+ - We lose some data continuity.
264
+ - But the stable set of benchmarks used for the dashboard are not affected,
265
+ and they provide the greatest continuity.
266
+ - If the code hasn't changed much, it won't have much effect.
267
+
268
+ To balance these requires choosing a good refresh period. A period of three
269
+ years is reasonable:
270
+ - It's not too frequent (as 1 year would be, for example) while avoiding some
271
+ sub-optimal occurrences from the past (e.g. in 2022 numerous crates that were
272
+ more than five years old were updated).
273
+ - It aligns with the Rust edition cycle.
274
+
275
+ Update policy
276
+ - The third-party crates should be updated in the year following a new edition.
277
+ (Based on the current edition cadence, this is every three years. If the
278
+ edition cadence changes in the future, this period should be reconsidered.)
279
+ The update should occur roughly six months after the edition hits a stable
280
+ Rust release, to give crate authors a decent amount of time to update to the
281
+ new edition.
282
+ - All third-party crates that have had at least one new release should be
283
+ updated, even if not much code has changed. This avoids having to make
284
+ decisions about whether a crate has changed enough.
285
+ - When doing this mass update, there may be some benchmarks that are deemed no
286
+ longer interesting and removed. Likewise, there may be some new benchmarks
287
+ that are added.
288
+ - New versions should be added before old versions are removed, to ensure
289
+ continuity of profiling coverage.
290
+ - The ad hoc addition and removal of individual benchmarks can continue
291
+ independently of this update cycle, as per the judgment of the rustc-perf
292
+ maintainers.
293
+
294
+ History:
295
+ - The first mass update of third-party crates occurred in [March/April
296
+ 2022](https://hackmd.io/d9uE7qgtTWKDLivy0uoVQw).
0 commit comments