Godot performance optimization

From thedivergentai/GD-Agentic-Skills · View interactive version

Godot performance optimization is an AI agent skill from the GitHub repository thedivergentai/GD-Agentic-Skills. Expert blueprint for performance profiling and optimization (frame drops, memory leaks, draw calls) using Godot Profiler, object pooling, visibility culling, and bottleneck identification. Use when diagnosing lag, optimizing for target FPS, or reducing memory usage. Keywords profiling, Godot Profile

How to use this skill

Skill file

NEVER Do in Performance Optimization


Debug → Profiler (F3)

Tabs:

Profiler-Tab Decision Tree

Open Debug → Profiler first. MANDATORY load only the script for the hot tab/symptom.

Do NOT Load every perf script for a single hitch.

| Profiler / symptom | Likely cause | Script |

|--------------------|--------------|--------|

| Time — same script hot | Alloc / get_node / process | object_pool_system.gd, cache @onready; custom_monitor_profiler.gd |

| Time — off-screen AI/VFX | Process while invisible | MANDATORY manual_culling_logic.gd |

| Memory — climbs over time | Leaks / unique resources | shared_resource_strategy.gd; pair with debugging orphan tools |

| Physics — collision spikes | Query/node RayCast spam | MANDATORY low_level_physics_query.gd |

| GPU / draw calls | Unique sprites/meshes | MANDATORY multimesh_optimizer.gd / multimesh_foliage_manager.gd / texture_array_batching.gd |

| SceneTree overhead at scale | Canvas/mesh item spam | MANDATORY rendering_server_direct.gd |

| Main-thread hitch (gen/parse) | Sync heavy work | MANDATORY worker_thread_pool_manager.gd |

| Crowd path spikes | Nav agents same frame | navigation_agent_optimization.gd |

| Custom game metrics | Missing monitors | custom_performance_monitor.gd |

Available Scripts

[object_pool_system.gd](scripts/object_pool_system.gd)

MANDATORY for hot-path spawn/despawn — reuse, do not invent Array pop pools inline.

[manual_culling_logic.gd](scripts/manual_culling_logic.gd)

VisibilityNotifier-driven process disable for CPU-heavy off-screen entities.

[rendering_server_direct.gd](scripts/rendering_server_direct.gd)

RenderingServer canvas/mesh path when SceneTree overhead dominates.

[low_level_physics_query.gd](scripts/low_level_physics_query.gd)

Direct space-state queries vs hundreds of RayCast nodes.

[worker_thread_pool_manager.gd](scripts/worker_thread_pool_manager.gd)

WorkerThreadPool offload for heavy jobs.

[multimesh_optimizer.gd](scripts/multimesh_optimizer.gd) / [multimesh_foliage_manager.gd](scripts/multimesh_foliage_manager.gd)

Hardware instancing for dense meshes/foliage.

[texture_array_batching.gd](scripts/texture_array_batching.gd)

Texture2DArray batching to cut material switches.

[shared_resource_strategy.gd](scripts/shared_resource_strategy.gd)

Shared vs local-to-scene memory tradeoffs.

[navigation_agent_optimization.gd](scripts/navigation_agent_optimization.gd)

Staggered path updates for crowds.

[custom_monitor_profiler.gd](scripts/custom_monitor_profiler.gd) / [custom_performance_monitor.gd](scripts/custom_performance_monitor.gd)

Performance.get_monitor / custom monitors for game-specific spikes.

Expert Pointers (keep short)

Deep dives (on demand)

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.

Official Documentation

Related Skills

Prerequisites
Complements
Downstream / consumers
Master
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.