Expand description
Cross-platform performance instrumentation.
Tag a function with #[vor::profile], a whole impl with
#[vor::all_functions], or open a scoped block with
profile_scope!. Each tag emits a puffin scope (frame-buffer
source for an in-app flame chart), a tracing span (sink source:
Chrome-trace file on mac, DevTools timeline on web), and —
under the cuda feature — an NVTX range for NVIDIA Nsight Systems.
Frame boundaries: call frame_mark once per rendered frame so
puffin can group scopes by frame.
Macros§
- profile_
scope - Open a profiling scope for the rest of the enclosing block.
Structs§
- Frame
- One captured frame.
- Frame
Stats - Streaming p50 / p95 / p99 over per-frame nanosecond samples.
- Guard
- Opaque per-process guard. Drop to flush.
- IoTick
- Snapshot of one frame’s I/O totals.
- Metric
Column - A metric column from a capture: name + unit, for labeling the plotted row.
- Reader
- Streaming reader over a
.vorcapture. - Scope
Guard - Open guard for a runtime-named scope; the scope closes when it drops.
- System
Sample - One frame’s worth of vor-owned system metrics.
Traits§
- Sink
- A profiler backend.
Functions§
- calibrate
- Measure the per-span overhead of
tracing::trace_span. - current_
memory_ bytes - drain_
io - Read + reset the I/O accumulator. Call once per rendered frame
(after
frame_mark) so the next frame’s totals start from zero. - empty_
span_ ns - enable
- Turn on puffin scope collection process-wide.
- flush_
recording - Block until every captured frame is written to the
VOR_RECORDstream. No-op when not recording. Call before exit so a reader sees the run’s final frames. - frame_
mark - Mark a frame boundary in puffin’s ring buffer.
- record_
io - Add one I/O event to the current frame’s totals.
- record_
metric - Record the latest value of a named scalar for the current frame.
- record_
metric_ unit - Attach a unit (e.g.
"ms","tok/s") to a named metric’s plotted row, once. The recorder reads it when it first declares the column, so call this before the metric’s firstrecord_metric(e.g. at startup). Metrics with no registered unit are unitless. - scope
- Open a profiling scope named at run time, the dynamic counterpart to
profile_scope!. The returned guard closes the scope on drop, and the scope shows in the flame chart undername.
Attribute Macros§
- all_
functions #[all_functions]— profile every method in animplblock.- profile
#[profile]— tag a function or method as a profiling scope.- skip
#[skip]— exclude a method from an enclosingall_functions.