mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-03 01:25:37 +00:00
hotpath: add measure to MpscTunnelSender::send and send_msg_by_ip
Adds hotpath::measure to two critical blind spots in the send chain:
1. MpscTunnelSender::send — the tokio mpsc channel send point, which
accounts for 84% of PeerConn::send_msg wall time (2.33us/pkt).
2. PeerManager::send_msg_by_ip — the top-level packet send entry point,
revealing a 1.04us gap between send_msg_by_ip and send_msg_internal
(encryption + routing + ACL + fan-out).
Full send chain timing now visible:
send_msg_by_ip: 3.83us
└─ send_msg_internal: 2.79us (gap: 1.04us = encrypt + route + ACL)
└─ MpscTunnelSender::send: 2.33us (84% of internal)
This commit is contained in:
@@ -1718,6 +1718,7 @@ impl PeerManager {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "hotpath", hotpath::measure(impl_type = "PeerManager"))]
|
||||||
pub async fn send_msg_by_ip(
|
pub async fn send_msg_by_ip(
|
||||||
&self,
|
&self,
|
||||||
mut msg: ZCPacket,
|
mut msg: ZCPacket,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ use futures::SinkExt;
|
|||||||
pub struct MpscTunnelSender(Sender<ZCPacket>);
|
pub struct MpscTunnelSender(Sender<ZCPacket>);
|
||||||
|
|
||||||
impl MpscTunnelSender {
|
impl MpscTunnelSender {
|
||||||
|
#[cfg_attr(feature = "hotpath", hotpath::measure(impl_type = "MpscTunnelSender"))]
|
||||||
pub async fn send(&self, item: ZCPacket) -> Result<(), TunnelError> {
|
pub async fn send(&self, item: ZCPacket) -> Result<(), TunnelError> {
|
||||||
match self.0.try_send(item) {
|
match self.0.try_send(item) {
|
||||||
Ok(()) => Ok(()),
|
Ok(()) => Ok(()),
|
||||||
|
|||||||
Reference in New Issue
Block a user