smelt_perf/lib.rs
1//! Lightweight allocation + timing instrumentation.
2//!
3//! Two coordinated pieces:
4//! - [`alloc::Counting`] — global allocator shim that bumps process and per-thread counters
5//! when [`alloc::enable`] has been called. Cheap when disabled.
6//! - [`perf::begin`] — RAII scope guards that record duration and per-thread alloc deltas under
7//! a `&'static str` label. Snapshot via [`perf::snapshot`], pretty-print via
8//! [`perf::print_summary`].
9//!
10//! Designed to be embedded in any binary: install `Counting` as `#[global_allocator]`, call
11//! `alloc::enable()` and `perf::enable()` early in `main`, sprinkle `let _g = perf::begin(...);`
12//! around interesting scopes.
13
14pub mod alloc;
15pub mod perf;