profiler-hotpath
Identify performance bottlenecks in Unity by analyzing the most expensive functions in profiler frames, helping developers optimize code execution.
Instructions
Returns the top N most expensive functions in a profiler frame, sorted by self time or total time. Useful for quickly identifying performance bottlenecks without reading the full hierarchy.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frameIndex | No | Frame index to analyze. Use -1 for the latest available frame. Default: -1 | -1 |
| threadIndex | No | Thread index. 0 = Main Thread. Default: 0 | 0 |
| topN | No | Number of top entries to return. Default: 20 | 20 |
| sortBy | No | Sort by 'selfTime' or 'totalTime'. Default: selfTime Values: [TotalTime, SelfTime] | selfTime |
| maxDepth | No | Maximum tree depth to scan. Deeper = more complete but slower. Default: 15 | 15 |