Skip to content

Commit

Permalink
Add benchmarking for FilesystemStore
Browse files Browse the repository at this point in the history
We re-add benchmarking for `FilesystemStore` now that we switched over
to it.
  • Loading branch information
tnull committed Sep 7, 2023
1 parent 0182717 commit 44ec308
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions bench/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 14 additions & 0 deletions lightning-persister/src/fs_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 44ec308

Please sign in to comment.