profile_project
Capture Godot Profiler function timings for a running game to find hot functions and frame-budget overruns. Requires profiling enabled at launch; blocks for the set duration.
Instructions
Capture a window of Godot's function profiler - the editor's Profiler tab numbers. Requires run_project with profiling: true. Blocks for seconds (default 5). Times are elapsed, not CPU; inclusive rows overlap - never sum totalMs. Returns: rows (function, file, line, calls, selfMs/totalMs, per-frame averages, percentOfFrame, peak), the frame budget, servers, worstFrame, plus frames/frameGaps/limitReached for capture quality. Errors if profiling was off at launch or a capture is already open.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | How many functions to return, 1..100 (default: 20). | |
| sort | No | Rank by own time ("selfMs", default), inclusive time ("totalMs"), or invocation count ("calls"). | |
| seconds | No | Capture duration in seconds, greater than 0 and at most 60 (default: 5). | |
| captureLimit | No | Rows the engine puts in each frame packet, 16..512 (default: 512). Godot selects them by inclusive time, so a lower limit hides cheap functions and sets limitReached. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | ||
| sort | No | ||
| frame | No | ||
| frames | No | ||
| seconds | No | ||
| servers | No | ||
| frameGaps | No | ||
| lastFrame | No | ||
| firstFrame | No | ||
| worstFrame | No | ||
| captureLimit | No | ||
| limitReached | No | ||
| framesReceived | No | ||
| functionsReceived | No | ||
| undecodablePackets | No | ||
| unresolvedFunctions | No |