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
+5 -3
View File
@@ -572,8 +572,9 @@ pub struct UdpTunnelListener {
impl UdpTunnelListener {
pub fn new(addr: url::Url) -> Self {
let (close_event_send, close_event_recv) = tokio::sync::mpsc::unbounded_channel();
let (conn_send, conn_recv) = tokio::sync::mpsc::channel(100);
let (close_event_send, close_event_recv) =
hotpath::channel!(tokio::sync::mpsc::unbounded_channel());
let (conn_send, conn_recv) = hotpath::channel!(tokio::sync::mpsc::channel(100));
Self {
addr: addr.clone(),
socket: None,
@@ -784,7 +785,8 @@ impl UdpTunnelConnector {
"udp build tunnel for connector"
);
let (close_event_sender, mut close_event_recv) = tokio::sync::mpsc::unbounded_channel();
let (close_event_sender, mut close_event_recv) =
hotpath::channel!(tokio::sync::mpsc::unbounded_channel());
let ring_recv = RingStream::new(ring_for_send_udp.clone());
let ring_sender = RingSink::new(ring_for_recv_udp.clone());