feat: add optional hotpath profiling support (#2380)

* feat: add hotpath profiling support
* perf(hotpath): make hotpath an optional dependency
This commit is contained in:
fanyang
2026-06-27 13:12:28 +08:00
committed by GitHub
parent f0d00d6161
commit be2034dd06
18 changed files with 322 additions and 27 deletions
+2
View File
@@ -132,6 +132,7 @@ impl PeerMap {
peer_id == self.my_peer_id || self.peer_map.contains_key(&peer_id)
}
#[cfg_attr(feature = "hotpath", hotpath::measure(impl_type = "PeerMap"))]
pub async fn send_msg_directly(&self, msg: ZCPacket, dst_peer_id: PeerId) -> Result<(), Error> {
if dst_peer_id == self.my_peer_id {
let packet_send = self.packet_send.clone();
@@ -163,6 +164,7 @@ impl PeerMap {
Ok(())
}
#[cfg_attr(feature = "hotpath", hotpath::measure(impl_type = "PeerMap"))]
pub async fn get_gateway_peer_id(
&self,
dst_peer_id: PeerId,