Builtin Library
README.md
profiler
The profiler model — the single source of truth that turns the engine's flat profiling surface (getProfilingDataTable, getLuauVmDataTable, profiler.stopCapture) into the honest, self-accounting hierarchy every profiler tool and the System Tools Profiler tab reads from.
Location: src/lua/lib/modules/profiler.module
Required as require("modules.profiler").
What it composes
- A nested tree where every node carries
total_ms,self_ms(own time excluding children),calls, andpctof the frame. - An explicit
present / idlenode — the frame time no schedule covers (the frame-limiter / vsync wait, GPU present, event loop) — so nothing vanishes. - Per-component
update(dt)attribution grafted underlua_update.vm_call, so a heavy script names the entity + component an author can open and fix. - Per-component coroutine-resume attribution under
task_scheduler, so a busy scheduler names the component whose tasks it resumed. - Windowed aggregation over a capture: avg / p50 / p90 / p99 / max frame time, the worst single frame, and spike counting.
The model + format functions are pure — the tools and the UI produce identical numbers from identical inputs. See the profiler toolbox for the tools that read this model.