Expand description
Lightweight allocation + timing instrumentation.
Two coordinated pieces:
alloc::Counting— global allocator shim that bumps process and per-thread counters whenalloc::enablehas been called. Cheap when disabled.perf::begin— RAII scope guards that record duration and per-thread alloc deltas under a&'static strlabel. Snapshot viaperf::snapshot, pretty-print viaperf::print_summary.
Designed to be embedded in any binary: install Counting as #[global_allocator], call
alloc::enable() and perf::enable() early in main, sprinkle let _g = perf::begin(...);
around interesting scopes.
Modules§
- alloc
- Counting global-allocator shim. Process-wide counters always update so peak / current /
dealloc stats stay consistent across the whole run; per-thread tallies (used by
crate::perf::Guard) only update whenenablehas been called. Install via#[global_allocator]in the binary crate. - perf
- Labelled scope guards plus a pretty-printer.