Skip to main content

Module profiler

Module profiler 

Source
Expand description

Profiling utilities for task, frame, and thread performance tracking. Timing for tasks, actions and window frames.

Recording is compiled in with the profiler feature. Without it, the functions that return timings return empty results, and the recording functions do nothing. Even with the feature, task and frame events in the trace buffers are kept only while tracing is on; set_trace_enabled controls that state. The foreground journal, which App::foreground_journal reads, records them regardless. With the feature, each window also keeps its histograms, whether or not tracing is on.

To see frame times on screen, set the debug frame overlay mode with Window::set_debug_frame_overlay_mode. To read the numbers in code, call Window::frame_duration_snapshot and Window::input_latency_snapshot. Those three window methods exist only with the profiler feature. The performance guide walks through them.

Structs§

SerializedLocation
Serializable variant of core::panic::Location
SerializedTaskTiming
Serializable variant of [TaskTiming]
SerializedThreadTaskTimings
Serializable variant of [ThreadTaskTimings]

Functions§

set_trace_enabled
Turns trace collection on or off, and returns true if the setting changed.
trace_enabled
Returns true while trace collection is on, either from set_trace_enabled or from an active trace scope.