Analyze GLua Hot-Path Performance
analyze_performanceProfiles Garry's Mod Lua code statically to identify performance bottlenecks, GC issues, and per-frame hook allocations, preventing FPS stutter and tickrate drops.
Instructions
Profile Garry's Mod Lua code via static AST inspection to detect runtime performance traps, Zero-GC violations, and LuaJIT garbage collector bottlenecks. Purely analytical static inspection; does NOT execute code, does NOT evaluate scripts in a VM, and does NOT modify files on disk. Operates under zero-side-effect guarantees. Provide either file_path (workspace path) or code_content (raw snippet); when both are supplied, file_path takes precedence. Automatically inspects high-frequency rendering and simulation hooks (HUDPaint, RenderScreenspaceEffects, Think, Move). Use this tool to prevent client FPS stutter and server tickrate drops by flagging table allocations (Color(), Vector(), Angle()), unlocalized global lookups, and dynamic font creation inside per-frame hooks. Do NOT use for syntax or realm correctness checks (use lint_glua instead), network message exploit detection (use audit_net_security instead), or functional assertion testing (use run_glua_test instead). Returns a GModToolResult envelope with status ('success' or 'failed'), summary, and data containing performance_score (0-100), issues array (hook_name, line, severity, category, description, recommended_code), and allocation metrics (allocations_in_hot_path, global_calls_in_hot_path, dynamic_draw_calls).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | No | Workspace path to .lua file to profile. Takes precedence over code_content when both are supplied. | |
| code_content | No | Direct GLua source code snippet to profile. Ignored if file_path is provided. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Domain-specific typed payload returned by the tool. | |
| status | Yes | Execution status of the tool call ('success', 'partial', 'blocked', or 'failed'). | |
| summary | Yes | Concise, human-readable summary of operational findings, diagnostics, or execution outcome. | |
| evidence | Yes | Traceability evidence including cited documentation and generated artifacts. | |
| warnings | Yes | List of non-fatal warnings, lint advisories, engine caveats, or security notices. | |
| nextActions | No | Actionable, ordered recommendations for the agent's immediate next steps. |