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