]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add benchmarking for `FilesystemStore`
authorElias Rohrer <dev@tnull.de>
Fri, 4 Aug 2023 09:34:45 +0000 (11:34 +0200)
committerElias Rohrer <dev@tnull.de>
Thu, 7 Sep 2023 20:49:22 +0000 (22:49 +0200)
We re-add benchmarking for `FilesystemStore` now that we switched over
to it.

bench/benches/bench.rs
lightning-persister/src/fs_store.rs

index 3fc3abe687b13aafac41074dc891f169771dba14..bc4bd010822ddc24d84c3d761f7da63d8e7fad99 100644 (file)
@@ -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);
index 638e74e650607f09bb806b4776777a5ad3a954eb..56d071da9f0b86ad4cf3571b9e64e8dc3c950e0e 100644 (file)
@@ -515,3 +515,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);
+       }
+}