diff --git a/pageserver/benches/bench_walredo.rs b/pageserver/benches/bench_walredo.rs index ccb4f50eb4..da7c674995 100644 --- a/pageserver/benches/bench_walredo.rs +++ b/pageserver/benches/bench_walredo.rs @@ -45,33 +45,39 @@ use tokio::{sync::Barrier, task::JoinSet}; use utils::{id::TenantId, lsn::Lsn}; fn bench(c: &mut Criterion) { - { - let nclients = [1, 2, 4, 8, 16, 32, 64, 128]; - for nclients in nclients { - let mut group = c.benchmark_group("short"); - group.bench_with_input( - BenchmarkId::from_parameter(nclients), - &nclients, - |b, nclients| { - let redo_work = Arc::new(Request::short_input()); - b.iter_custom(|iters| bench_impl(Arc::clone(&redo_work), iters, *nclients)); - }, - ); + for process_kind in &[ + pageserver::walredo::ProcessKind::Async, + pageserver::walredo::ProcessKind::Sync, + ] { + pageserver::walredo::set_process_kind(*process_kind); + { + let nclients = [1, 2, 4, 8, 16, 32, 64, 128]; + for nclients in nclients { + let mut group = c.benchmark_group(format!("{process_kind}-short")); + group.bench_with_input( + BenchmarkId::from_parameter(nclients), + &nclients, + |b, nclients| { + let redo_work = Arc::new(Request::short_input()); + b.iter_custom(|iters| bench_impl(Arc::clone(&redo_work), iters, *nclients)); + }, + ); + } } - } - { - let nclients = [1, 2, 4, 8, 16, 32, 64, 128]; - for nclients in nclients { - let mut group = c.benchmark_group("medium"); - group.bench_with_input( - BenchmarkId::from_parameter(nclients), - &nclients, - |b, nclients| { - let redo_work = Arc::new(Request::medium_input()); - b.iter_custom(|iters| bench_impl(Arc::clone(&redo_work), iters, *nclients)); - }, - ); + { + let nclients = [1, 2, 4, 8, 16, 32, 64, 128]; + for nclients in nclients { + let mut group = c.benchmark_group(format!("{process_kind}-medium")); + group.bench_with_input( + BenchmarkId::from_parameter(nclients), + &nclients, + |b, nclients| { + let redo_work = Arc::new(Request::medium_input()); + b.iter_custom(|iters| bench_impl(Arc::clone(&redo_work), iters, *nclients)); + }, + ); + } } } } diff --git a/pageserver/src/walredo.rs b/pageserver/src/walredo.rs index 24b6563e32..438a2ec8a2 100644 --- a/pageserver/src/walredo.rs +++ b/pageserver/src/walredo.rs @@ -20,7 +20,7 @@ /// Process lifecycle and abstracction for the IPC protocol. mod process; -pub(crate) use process::{set_kind as set_process_kind, Kind as ProcessKind}; +pub use process::{set_kind as set_process_kind, Kind as ProcessKind}; /// Code to apply [`NeonWalRecord`]s. pub(crate) mod apply_neon; diff --git a/pageserver/src/walredo/process.rs b/pageserver/src/walredo/process.rs index c340cd9015..d95c1f7f26 100644 --- a/pageserver/src/walredo/process.rs +++ b/pageserver/src/walredo/process.rs @@ -55,7 +55,7 @@ impl Kind { static PROCESS_KIND: AtomicU8 = AtomicU8::new(Kind::DEFAULT as u8); -pub(crate) fn set_kind(kind: Kind) { +pub fn set_kind(kind: Kind) { PROCESS_KIND.store(kind as u8, std::sync::atomic::Ordering::Relaxed); #[cfg(not(test))] {