Expand description
Feature-gated encode/decode stage profiler — the instrument for perf work.
Zero cost unless the profile cargo feature is enabled: with it off,
scope is a no-op returning a ZST guard the optimizer elides entirely, so
release builds are byte-identical and the hot path is untouched. With it on,
each stage times itself into an atomic tick bucket; dump prints the
per-stage breakdown and snapshot returns a calibrated reading so a driver
can run many passes and take per-stage medians.
Design mirrors rusty_h264-common/src/prof.rs (rdtsc ticks + wall-clock
anchor calibration). A Stage::Total scope wraps OpusEncoder::encode();
the mgmt/other line is the residue (Total − Σ stages) — decompose it
until every line is named, or prove it equals the timer overhead
(Σ calls × ~2 × tick cost).
Structs§
- Guard
- No-op guard (ZST) — elided in release.
Enums§
- Stage
- A timed pipeline stage. Order matters: everything before
Totalis a sub-component summed for themgmt/otherresidue.
Constants§
- INFO_
FIRST - Index of the first info-tier stage — buckets
INFO_FIRST..Totalare nested diagnostics excluded from themgmt/otherresidue sum. - N
- Number of buckets.