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:
fanyang
2026-06-28 10:43:55 +08:00
committed by GitHub
parent be2034dd06
commit 7205517160
32 changed files with 123 additions and 80 deletions
+2 -1
View File
@@ -1,9 +1,10 @@
use dashmap::DashMap;
use hotpath::instant::Instant;
use serde::{Deserialize, Serialize};
use std::cell::UnsafeCell;
use std::fmt;
use std::sync::Arc;
use std::time::{Duration, Instant};
use std::time::Duration;
use tokio::time::interval;
use tokio_util::task::AbortOnDropHandle;