aboutsummaryrefslogtreecommitdiffstats
path: root/src/simtest/bench.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/simtest/bench.rs')
-rw-r--r--src/simtest/bench.rs8
1 files changed, 5 insertions, 3 deletions
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()