From a0fa9eef40ffea454117faec5fdc4332f5dac90f Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Fri, 4 Aug 2023 11:34:45 +0200 Subject: [PATCH] Add benchmarking for `FilesystemStore` We re-add benchmarking for `FilesystemStore` now that we switched over to it. --- bench/benches/bench.rs | 1 + lightning-persister/src/fs_store.rs | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/bench/benches/bench.rs b/bench/benches/bench.rs index 3fc3abe68..bc4bd0108 100644 --- a/bench/benches/bench.rs +++ b/bench/benches/bench.rs @@ -15,6 +15,7 @@ criterion_group!(benches, lightning::routing::router::benches::generate_large_mpp_routes_with_probabilistic_scorer, lightning::sign::benches::bench_get_secure_random_bytes, lightning::ln::channelmanager::bench::bench_sends, + lightning_persister::fs_store::bench::bench_sends, lightning_rapid_gossip_sync::bench::bench_reading_full_graph_from_file, lightning::routing::gossip::benches::read_network_graph, lightning::routing::gossip::benches::write_network_graph); diff --git a/lightning-persister/src/fs_store.rs b/lightning-persister/src/fs_store.rs index 692c296cf..2573a8787 100644 --- a/lightning-persister/src/fs_store.rs +++ b/lightning-persister/src/fs_store.rs @@ -422,3 +422,17 @@ mod tests { added_monitors.clear(); } } + +#[cfg(ldk_bench)] +/// Benches +pub mod bench { + use criterion::Criterion; + + /// Bench! + pub fn bench_sends(bench: &mut Criterion) { + let store_a = super::FilesystemStore::new("bench_filesystem_store_a".into()); + let store_b = super::FilesystemStore::new("bench_filesystem_store_b".into()); + lightning::ln::channelmanager::bench::bench_two_sends( + bench, "bench_filesystem_persisted_sends", store_a, store_b); + } +} -- 2.39.5