From: Jeffrey Czyz Date: Mon, 17 Jan 2022 04:54:42 +0000 (-0600) Subject: Add ProbabilisticScorer benchmarks X-Git-Tag: v0.0.105~22^2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=d5db85ecc5f71ff4c37b3d295fbc8e0f773d0b24;p=rust-lightning Add ProbabilisticScorer benchmarks --- diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index f31bfd2ea..a21cf79a1 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -4984,7 +4984,7 @@ mod benches { use chain::transaction::OutPoint; use ln::channelmanager::{ChannelCounterparty, ChannelDetails}; use ln::features::{InitFeatures, InvoiceFeatures}; - use routing::scoring::{FixedPenaltyScorer, Scorer}; + use routing::scoring::{FixedPenaltyScorer, ProbabilisticScorer, ProbabilisticScoringParameters, Scorer}; use util::logger::{Logger, Record}; use test::Bencher; @@ -5061,6 +5061,22 @@ mod benches { generate_routes(bench, &network_graph, scorer, InvoiceFeatures::known()); } + #[bench] + fn generate_routes_with_probabilistic_scorer(bench: &mut Bencher) { + let network_graph = read_network_graph(); + let params = ProbabilisticScoringParameters::default(); + let scorer = ProbabilisticScorer::new(params, &network_graph); + generate_routes(bench, &network_graph, scorer, InvoiceFeatures::empty()); + } + + #[bench] + fn generate_mpp_routes_with_probabilistic_scorer(bench: &mut Bencher) { + let network_graph = read_network_graph(); + let params = ProbabilisticScoringParameters::default(); + let scorer = ProbabilisticScorer::new(params, &network_graph); + generate_routes(bench, &network_graph, scorer, InvoiceFeatures::known()); + } + fn generate_routes( bench: &mut Bencher, graph: &NetworkGraph, mut scorer: S, features: InvoiceFeatures ) {