-
-
Notifications
You must be signed in to change notification settings - Fork 16k
Stabilize #[bench] and Bencher? #66287
Copy link
Copy link
Open
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryB-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.T-langRelevant to the language teamRelevant to the language teamT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Activity
Metadata
Metadata
Assignees
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryB-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.T-langRelevant to the language teamRelevant to the language teamT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Projects
- StatusShow more project fieldsNo status
I’ll take the liberty of copying a section of @hsivonen’s Rust 2020 blog post:
Indeed the existing benchmarking support has basically not changed in years, and I’m not aware of anyone planning to work on it. To keep reserving the right to make breaking changes is not useful at this point. Custom test frameworks offer another way forward for when someone does want to work on better benchmarking.
So I’d like to propose a plan:
test::Benchertostd::bench::Bencher.I have a PR coming soon thatMovetest::Bencherto a new (unstable)std::benchmodule #66290 demonstrates that this is possible. This move avoids the need to stabilize thetestcrate.Bencher. For example, the publicbytesfield could become a parameter to some method.bytesfield anditermethod unchanged as unstable + deprecated for a while.#[bench]attribute and just enough ofBencherto make it usable with#[bench]. (For example, no stable constructor.)@rust-lang/libs, @rust-lang/lang, do you feel this needs an RFC?