smelt-perf
Lightweight allocation and timing instrumentation.
Two coordinated pieces:
alloc::Counting: a global allocator shim that bumps process and per-thread counters whenalloc::enable()has 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, then sprinkle let _g = perf::begin("scope.label"); around
interesting scopes.
use ;
static A: Counting = Counting;
Part of the smelt project but usable standalone.
License
MIT