@@ -8747,14 +8747,23 @@ pub mod benches {
8747
8747
score_params : & S :: ScoreParams , features : Bolt11InvoiceFeatures , starting_amount : u64 ,
8748
8748
bench_name : & ' static str ,
8749
8749
) {
8750
- let payer = bench_utils:: payer_pubkey ( ) ;
8751
- let keys_manager = KeysManager :: new ( & [ 0u8 ; 32 ] , 42 , 42 ) ;
8752
- let random_seed_bytes = keys_manager. get_secure_random_bytes ( ) ;
8753
-
8754
8750
// First, get 100 (source, destination) pairs for which route-getting actually succeeds...
8755
8751
let route_endpoints = bench_utils:: generate_test_routes ( graph, & mut scorer, score_params, features, 0xdeadbeef , starting_amount, 50 ) ;
8756
8752
8757
8753
// ...then benchmark finding paths between the nodes we learned.
8754
+ do_route_bench ( bench, graph, scorer, score_params, bench_name, route_endpoints) ;
8755
+ }
8756
+
8757
+ #[ inline( never) ]
8758
+ fn do_route_bench < S : ScoreLookUp + ScoreUpdate > (
8759
+ bench : & mut Criterion , graph : & NetworkGraph < & TestLogger > , scorer : S ,
8760
+ score_params : & S :: ScoreParams , bench_name : & ' static str ,
8761
+ route_endpoints : Vec < ( ChannelDetails , PaymentParameters , u64 ) > ,
8762
+ ) {
8763
+ let payer = bench_utils:: payer_pubkey ( ) ;
8764
+ let keys_manager = KeysManager :: new ( & [ 0u8 ; 32 ] , 42 , 42 ) ;
8765
+ let random_seed_bytes = keys_manager. get_secure_random_bytes ( ) ;
8766
+
8758
8767
let mut idx = 0 ;
8759
8768
bench. bench_function ( bench_name, |b| b. iter ( || {
8760
8769
let ( first_hop, params, amt) = & route_endpoints[ idx % route_endpoints. len ( ) ] ;
0 commit comments