diff --git a/veilid-core/src/routing_table/route_spec_store.rs b/veilid-core/src/routing_table/route_spec_store.rs index db8a2ca0..87b0d283 100644 --- a/veilid-core/src/routing_table/route_spec_store.rs +++ b/veilid-core/src/routing_table/route_spec_store.rs @@ -1285,6 +1285,8 @@ impl RouteSpecStore { safety_selection: SafetySelection, mut private_route: PrivateRoute, ) -> EyreResult> { + // let profile_start_ts = get_timestamp(); + let inner = &mut *self.inner.lock(); let routing_table = self.unlocked_inner.routing_table.clone(); let rti = &mut *routing_table.inner.write(); @@ -1327,6 +1329,7 @@ impl RouteSpecStore { first_hop.set_sequencing(sequencing); // Return the compiled safety route + //println!("compile_safety_route profile (stub): {} us", (get_timestamp() - profile_start_ts)); return Ok(Some(CompiledRoute { safety_route: SafetyRoute::new_stub(routing_table.node_id(), private_route), secret: routing_table.node_id_secret(), @@ -1380,6 +1383,7 @@ impl RouteSpecStore { first_hop, }; // Return compiled route + //println!("compile_safety_route profile (cached): {} us", (get_timestamp() - profile_start_ts)); return Ok(Some(compiled_route)); } } @@ -1498,6 +1502,7 @@ impl RouteSpecStore { }; // Return compiled route + //println!("compile_safety_route profile (uncached): {} us", (get_timestamp() - profile_start_ts)); Ok(Some(compiled_route)) } diff --git a/veilid-core/src/veilid_api/debug.rs b/veilid-core/src/veilid_api/debug.rs index 2349a97c..0eabf47f 100644 --- a/veilid-core/src/veilid_api/debug.rs +++ b/veilid-core/src/veilid_api/debug.rs @@ -53,7 +53,11 @@ fn get_route_id(rss: RouteSpecStore) -> impl Fn(&str) -> Option { }; } -fn get_safety_selection(text: &str, rss: RouteSpecStore) -> Option { +fn get_safety_selection(text: &str, routing_table: RoutingTable) -> Option { + let rss = routing_table.route_spec_store(); + let default_route_hop_count = + routing_table.with_config(|c| c.network.rpc.default_route_hop_count as usize); + if text.len() != 0 && &text[0..1] == "-" { // Unsafe let text = &text[1..]; @@ -62,7 +66,7 @@ fn get_safety_selection(text: &str, rss: RouteSpecStore) -> Option impl FnOnce(&str) -> Option