What it does
profiler
Profiler tab for the System Tools inspector — frame timing, schedules,
peaks, plus pause / reset / export-sample controls. Refreshes at 2 Hz
(fast enough to feel live, slow enough to keep three-decimal ms
readable). Data source is the engine-cached getProfilingDataTable(),
which is effectively free to read.
Exports
M.build(_state) -> any— build the zui widget tree for the tab.M.onCallback(callbackId: string, _data, _state) -> boolean— handle pause / reset-peaks / export-sample.M.label: string— tab title.M.refresh: number— refresh cadence in seconds (0.5).
Usage
local Profiler = require("@builtin::modules.engine.editor.system_tools.tabs.profiler")
local widget = Profiler.build(state)
Profiler.onCallback("profiler-pause", nil, state)
Notes
- Pause locks the displayed snapshot in module-local state; peaks stop updating until resumed.
- Reset peaks zeroes worst-dt and worst/best-fps trackers without affecting the live snapshot.
- Export writes a pretty-printed JSON sample to
/zero/source/profiler_samples/sample_<ms>.jsonviavfs.write. - All three buttons share a 100 ms debounce — egui delivers press + release in the same frame, and without debounce every toggle would fire twice.
- Per-system rows below 0.1 ms are hidden as noise.
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.