Profiler
A browser-DevTools-style profiler for a dvui GUI: a perf chart, a navigable
widget tree, and an inspector. The controlling app owns the window and the
frame loop and hands the target app's GUI to Profiler.run as a plain
function; the profiler invokes it inside an instrumented viewport so it can
time it and capture its widget tree (via Debug.captureScopeBegin/End)
without the target ever touching the window.
Persist one Profiler across frames (the app owns a var prof: Profiler)
and call prof.run(@src(), targetFn) once per dvui frame.
This is the basis for Turian's in-engine GUI profiler; it consumes the same
data as Window.renderStats (#1), Window.frameTiming (#3), and
Debug.dumpFrame (#2).
Fields
- history:[history_len]Sample
Ring buffer of recent per-frame samples;
headis the next write slot.- head:usize
- usize
- count:usize
- usize
- last_build_ns:u64
Most recent target build time, for the readout.
Types
Functions
- run
Render one profiler frame: run
targetin an instrumented viewport on the