Expand description
Lightweight span profiler, compiled in only under the profile cargo
feature (what cargo profile-tui builds with). Shipped builds contain
zero instrumentation: without the feature, span() returns a unit
struct with no Drop, which the optimizer erases entirely. When
compiled in, recording is enabled by ITE_PROFILE=<output-path> and the
dump is a plain-text table. Stats and format_duration stay
unconditional — the profile driver uses them for its own latency report.
Structs§
- Span
- Zero-cost stand-in: a unit struct with no
Drop, sospan()calls vanish under optimization.#[inline(always)]matters — the binary crate calls this across the crate boundary, where a non-generic function would otherwise survive without LTO. - Stats
- Summary statistics over a set of durations.
Functions§
- format_
duration - Adaptive human-readable duration: ns, µs, ms, or s.
- span