Skip to content

Commit 2ff0a87

Browse files
committed
fmt code
1 parent 7035d41 commit 2ff0a87

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

benches/microbench/src/get_header.rs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//! selection. This is wall-clock timing — useful for local development feedback
88
//! and catching latency regressions across relay counts.
99
//!
10-
//! Criterion runs each benchmark hundreds of times, applies statistical analysis,
11-
//! and reports mean ± standard deviation. Results are saved to
10+
//! Criterion runs each benchmark hundreds of times, applies statistical
11+
//! analysis, and reports mean ± standard deviation. Results are saved to
1212
//! `target/criterion/` as HTML reports (open `report/index.html`).
1313
//!
1414
//! # Running
@@ -29,9 +29,12 @@
2929
//!
3030
//! # What is NOT measured
3131
//!
32-
//! - PBS HTTP server overhead (we call `get_header()` directly, bypassing axum routing)
33-
//! - Mock relay startup time (servers are started once in setup, before timing begins)
34-
//! - `HeaderMap` allocation (created once in setup, cloned cheaply per iteration)
32+
//! - PBS HTTP server overhead (we call `get_header()` directly, bypassing axum
33+
//! routing)
34+
//! - Mock relay startup time (servers are started once in setup, before timing
35+
//! begins)
36+
//! - `HeaderMap` allocation (created once in setup, cloned cheaply per
37+
//! iteration)
3538
3639
use std::{path::PathBuf, sync::Arc, time::Duration};
3740

@@ -73,7 +76,8 @@ fn bench_get_header(c: &mut Criterion) {
7376
let rt = tokio::runtime::Runtime::new().expect("tokio runtime");
7477

7578
// Start all mock relays once and build one PbsState per relay-count variant.
76-
// All relays share the same MockRelayState (and therefore the same signing key).
79+
// All relays share the same MockRelayState (and therefore the same signing
80+
// key).
7781
let (states, params) = rt.block_on(async {
7882
let signer = random_secret();
7983
let pubkey = signer.public_key();
@@ -108,8 +112,9 @@ fn bench_get_header(c: &mut Criterion) {
108112
(states, params)
109113
});
110114

111-
// Empty HeaderMap matches what the PBS route handler receives for requests without
112-
// custom headers. Created once here to avoid measuring its allocation per iteration.
115+
// Empty HeaderMap matches what the PBS route handler receives for requests
116+
// without custom headers. Created once here to avoid measuring its
117+
// allocation per iteration.
113118
let headers = HeaderMap::new();
114119

115120
// A BenchmarkGroup groups related functions so Criterion produces a single
@@ -142,7 +147,8 @@ fn bench_get_header(c: &mut Criterion) {
142147
group.finish();
143148
}
144149

145-
// criterion_group! registers bench_get_header as a benchmark group named "benches".
146-
// criterion_main! generates the main() entry point that Criterion uses to run them.
150+
// criterion_group! registers bench_get_header as a benchmark group named
151+
// "benches". criterion_main! generates the main() entry point that Criterion
152+
// uses to run them.
147153
criterion_group!(benches, bench_get_header);
148154
criterion_main!(benches);

0 commit comments

Comments
 (0)