What changed, and why it matters
This commit only adds a new README.md file inside the benches folder. It is pure documentation explaining how to run and add benchmarks. No program code was changed, so it cannot introduce a security vulnerability or fix one.
No security action needed. Review as ordinary documentation if desired.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds benches/README.md, a documentation file describing Criterion-based benchmark usage, MSRV notes, cargo bench commands, and a template for new benchmarks. There are no source-code modifications, dependency changes, configuration changes, or logic changes.
Changed components
Inspect captured patch +77 / −0
diff --git a/benches/README.md b/benches/README.md
new file mode 100644
index 00000000..c4fa673b
--- /dev/null
+++ b/benches/README.md
@@ -0,0 +1,77 @@
+# Rust Bitcoin Benchmarks
+
+Criterion based benchmarks for `rust-bitcoin`.
+
+## Minimum Supported Rust Version (MSRV)
+
+This crate’s MSRV is determined by its Criterion dependency. It currently requires **Rust 1.81**.
+This higher MSRV applies only to the benches crate and does not affect other crates in this repository.
+
+## Running the benchmarks
+
+Examples below are run from within the crates folder `benches/`, if running from the repo root pass in `--manifest-path benches/Cargo.toml`.
+
+Run all benchmarks in this crate:
+
+```bash
+cargo bench
+```
+
+Run a specific benchmark target:
+
+```bash
+cargo bench --bench block
+```
+
+Pass options through to Criterion (see [More information](#more-information) for details):
+
+```bash
+# Save current results as a baseline named "before-change"
+cargo bench -- --save-baseline before-change
+
+# Compare to the saved baseline
+cargo bench -- --baseline before-change
+```
+
+View reports:
+
+- Criterion writes detailed html reports that are linked to in `target/criterion/report/index.html`.
+
+## Adding a new benchmark
+
+1. Create a new Rust file for your benchmark in the subfolder for the crate e.g. `benches/bitcoin/base58.rs`.
+2. Add it in `benches/Cargo.toml` including the path, with `harness = false`:
+
+```toml
+[[bench]]
+name = "base58"
+path = "bitcoin/base58.rs"
+harness = false
+```
+
+3. Criterion code template:
+
+```rust
+use criterion::{criterion_group, criterion_main, Criterion};
+
+fn bench_new_bench(c: &mut Criterion) {
+ c.bench_function("new_bench", |b| {
+ b.iter(|| {
+ // Benchmark code
+ })
+ });
+}
+
+criterion_group!(benches, bench_new_bench);
+criterion_main!(benches);
+```
+
+## More information
+
+- Criterion Book: <https://bheisler.github.io/criterion.rs/book/>
+- Criterion GitHub: <https://github.com/bheisler/criterion.rs>
+
+## Licensing
+
+The code in this project is licensed under the [Creative Commons CC0 1.0 Universal license](../LICENSE).
+We use the [SPDX license list](https://spdx.org/licenses/) and [SPDX IDs](https://spdx.dev/ids/).
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.