From 7c0f90b327ad567c4e5e6a96cda433d774182dac Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 6 Nov 2026 17:18:04 +0100 Subject: bench several scenarios --- src/simtest/bench.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/simtest/bench.rs') diff --git a/src/simtest/bench.rs b/src/simtest/bench.rs index ac44685..c3996a1 100644 --- a/src/simtest/bench.rs +++ b/src/simtest/bench.rs @@ -44,7 +44,8 @@ fn writes() -> usize { .unwrap_or(WRITES) } -/// Only the scenarios whose names contain this, if set: `BENCH_SCENARIO=NAT`. +/// Only the scenarios whose names contain this, if set: `BENCH_SCENARIO=NAT`; or any of +/// several, comma-separated, run at once (as `BENCH_PARALLEL`): `BENCH_SCENARIO=Tor,Mycelium`. const ONLY: &str = "BENCH_SCENARIO"; /// If set, all scenarios at once (`BENCH_PARALLEL=1`): several times faster on many /// cores, but they share them, so delays (and what depends on timing) may come out @@ -287,11 +288,12 @@ async fn bench_propagation() { // Past the test harness's `test … ...`, so each report is on a line of its own. println!(); let only = std::env::var(ONLY).unwrap_or_default(); + let parts: Vec<&str> = only.split(',').map(str::trim).collect(); let chosen: Vec<(u64, &'static Scenario)> = (70..) .zip(SCENARIOS) - .filter(|(_, scenario)| scenario.name.contains(&only)) + .filter(|(_, scenario)| parts.iter().any(|part| scenario.name.contains(part))) .collect(); - if std::env::var_os(PARALLEL).is_some() { + if std::env::var_os(PARALLEL).is_some() || parts.len() > 1 { // All at once, each reported when all are done, in order. let running: Vec<_> = chosen .into_iter() -- cgit v1.3.1