@@ -4978,6 +4978,15 @@ mod benches {
4978
4978
fn log ( & self , _record : & Record ) { }
4979
4979
}
4980
4980
4981
+ struct ZeroPenaltyScorer ;
4982
+ impl Score for ZeroPenaltyScorer {
4983
+ fn channel_penalty_msat (
4984
+ & self , _short_channel_id : u64 , _send_amt : u64 , _capacity_msat : Option < u64 > , _source : & NodeId , _target : & NodeId
4985
+ ) -> u64 { 0 }
4986
+ fn payment_path_failed ( & mut self , _path : & [ & RouteHop ] , _short_channel_id : u64 ) { }
4987
+ fn payment_path_successful ( & mut self , _path : & [ & RouteHop ] ) { }
4988
+ }
4989
+
4981
4990
fn read_network_graph ( ) -> NetworkGraph {
4982
4991
let mut d = test_utils:: get_route_file ( ) . unwrap ( ) ;
4983
4992
NetworkGraph :: read ( & mut d) . unwrap ( )
@@ -5017,6 +5026,20 @@ mod benches {
5017
5026
}
5018
5027
}
5019
5028
5029
+ #[ bench]
5030
+ fn generate_routes_with_zero_penalty_scorer ( bench : & mut Bencher ) {
5031
+ let network_graph = read_network_graph ( ) ;
5032
+ let scorer = ZeroPenaltyScorer ;
5033
+ generate_routes ( bench, & network_graph, scorer, InvoiceFeatures :: empty ( ) ) ;
5034
+ }
5035
+
5036
+ #[ bench]
5037
+ fn generate_mpp_routes_with_zero_penalty_scorer ( bench : & mut Bencher ) {
5038
+ let network_graph = read_network_graph ( ) ;
5039
+ let scorer = ZeroPenaltyScorer ;
5040
+ generate_routes ( bench, & network_graph, scorer, InvoiceFeatures :: known ( ) ) ;
5041
+ }
5042
+
5020
5043
#[ bench]
5021
5044
fn generate_routes_with_default_scorer ( bench : & mut Bencher ) {
5022
5045
let network_graph = read_network_graph ( ) ;
0 commit comments