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
+9
View File
@@ -5,6 +5,15 @@ use std::io;
use clap::Command;
use clap_complete::{Generator, Shell};
// When the `hotpath` feature is off, alias the current crate as `hotpath` so
// call sites keep using `hotpath::...` paths, and provide a local no-op shim
// for the profiling macros. This keeps `hotpath` an optional dependency: the
// profiler is absent from the dependency graph entirely in default builds.
#[cfg(not(feature = "hotpath"))]
extern crate self as hotpath;
#[cfg(not(feature = "hotpath"))]
mod hotpath_off;
mod arch;
mod gateway;
pub mod instance;