mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-04 10:05:42 +00:00
perf(core): use quanta::Instant for hot-path timing (#2384)
Replace std::time::Instant with quanta::Instant on per-packet, per-RPC, and per-session paths. TSC-based, ~5ns vs ~25ns per now() call. Reuses the existing `extern crate self as hotpath` alias so `use hotpath::instant::Instant;` resolves to the same quanta type with or without the hotpath feature. Leaves tokio::time::Instant and smoltcp::time::Instant untouched.
This commit is contained in:
@@ -5,10 +5,11 @@ use std::{
|
||||
Arc, Weak,
|
||||
atomic::{AtomicBool, AtomicUsize, Ordering},
|
||||
},
|
||||
time::{Duration, Instant},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use crossbeam::atomic::AtomicCell;
|
||||
use hotpath::instant::Instant;
|
||||
#[cfg(feature = "kcp")]
|
||||
use kcp_sys::{endpoint::KcpEndpoint, stream::KcpStream};
|
||||
use tokio_util::sync::{CancellationToken, DropGuard};
|
||||
|
||||
Reference in New Issue
Block a user