Expand description
CPU/GPU performance profiler with hierarchical timing, counters, and flame graph capture.
Usage:
ⓘ
let mut prof = Profiler::new();
prof.begin("render");
prof.begin("shadow_pass");
prof.end("shadow_pass");
prof.begin("gbuffer");
prof.end("gbuffer");
prof.end("render");
let report = prof.flush();Structs§
- Budget
Violation - A single budget violation record.
- Counter
- Named counter accumulator (e.g. draw calls, triangle count).
- Flame
Node - A node in the flame graph (hierarchical call tree).
- Frame
Budget - Defines target frame time budgets for different system categories.
- Frame
Record - All spans captured in one frame.
- GpuFrame
Stats - A frame of GPU timing data.
- GpuSpan
- A GPU timing query result (from GPU timestamp queries, if available).
- Marker
Log - Collection of profile markers for a session.
- Memory
Stats - Memory usage snapshot.
- Profile
Marker - A named annotation at a point in time (for debugging events).
- Profile
Overlay - Data ready for rendering a profiling overlay (e.g. a graph in the game).
- Profiler
- Main CPU profiler. Not thread-safe (use per-thread instances or a Mutex).
- Scoped
Span - RAII guard for automatic span end. Use with a
&mut Profiler. - Span
- A single profiling span (named time range).
- Span
Stats - Rolling statistics for a named span across frames.
- Stutter
Detector - Detects frame time spikes (stutters) by comparing against rolling average.
- Thread
Profile - Aggregator for multi-thread profiling results.
Enums§
- GpuPass
- Which render pass a GPU span belongs to.
Functions§
- export_
csv - Export the frame history to CSV format.
- merge_
thread_ profiles - Merge thread profiles into a combined FrameRecord.