thedivergentai/gd-agentic-skills

godot-performance-optimization

Expert blueprint for performance profiling and optimization (frame drops, memory leaks, draw calls) using Godot Profiler, object pooling, visibility culling, and bottleneck identification.

First seen Feb 10, 2026

Installation

$ npx skills add thedivergentai/gd-agentic-skills --skill godot-performance-optimization

Summary

  • 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 Profiler, bottleneck, object pooling, VisibleOnScreenNotifier, draw calls, MultiMesh.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from thedivergentai/gd-agentic-skills · top by installs.

npx skills add thedivergentai/gd-agentic-skills

Browse all from thedivergentai/gd-agentic-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 678
License LICENSE
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 12,140 B
  • docs SUMMARY.md 416 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 325 installs

SKILL.md

NEVER Do in Performance Optimization

  • NEVER optimize without profiling first — "I think physics is slow" without data? Premature optimization. ALWAYS use Debug → Profiler (F3) to identify actual bottleneck [20].
  • NEVER use print() in release buildsprint() every frame = file I/O bottleneck + log spam. Use @warningignore or conditional if OS.isdebug_build(): [21].
  • NEVER ignore VisibleOnScreenNotifier2D for off-screen entities — Enemies processing logic off-screen = wasted CPU. Disable setprocess(false) when screenexited [22].
  • NEVER instantiate nodes in hot loopsfor i in 1000: var bullet = Bullet.new() = 1000 allocations. Use object pools, reuse instances [23].
  • NEVER use getnode() in process() — Calling get_node("Player") 60x/sec = tree traversal spam. Cache in @onready var player := $Player [24].
  • NEVER forget to batch draw calls — 1000 unique sprites = 1000 draw calls. Use TextureAtlas (sprite sheets) + MultiMesh for instanced rendering [25].
  • NEVER block the main thread for heavy operations — Avoid OS.delay_msec() or long synchronous data processing. Use WorkerThreadPool to keep framerates steady.
  • NEVER use complex collision shapes for physics queries — High-poly convex shapes are expensive to resolve. Prefer simplified primitives (Circle, Rectangle, Box).
  • NEVER forget to disconnect local lambda signals — Anonymous lambdas connected to global signals can cause memory leaks if the capturing object is freed.
  • NEVER use large textures without VRAM compression — VRAM is limited. Use S3TC/BPTC for desktop (DirectX/Vulkan) and ETC2 for mobile. Note: Disable compression for Pixel Art to avoid artifacts [13].
  • NEVER perform tree modifications during physics steps — Adding/removing nodes during interray or physicsprocess can lock the physics server. Use call_deferred.
  • NEVER skip shader pre-warming in the Compatibility renderer — Unlike Forward+, OpenGL lacks Ubershaders. Pre-instantiate every mesh/VFX in front of the camera for 1 frame behind a loading screen to avoid hitches [21].

Debug → Profiler (F3)

Tabs:

  • Time: Function call times
  • Memory: RAM usage
  • Network: RPCs, bandwidth
  • Physics: Collision checks

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 [objectpoolsystem.gd](scripts/objectpoolsystem.gd), cache @onready; [custommonitorprofiler.gd](scripts/custommonitorprofiler.gd)
Time — off-screen AI/VFX Process while invisible MANDATORY [manualcullinglogic.gd](scripts/manualcullinglogic.gd)
Memory — climbs over time Leaks / unique resources [sharedresourcestrategy.gd](scripts/sharedresourcestrategy.gd); pair with debugging orphan tools
Physics — collision spikes Query/node RayCast spam MANDATORY [lowlevelphysicsquery.gd](scripts/lowlevelphysicsquery.gd)
GPU / draw calls Unique sprites/meshes MANDATORY [multimeshoptimizer.gd](scripts/multimeshoptimizer.gd) / [multimeshfoliagemanager.gd](scripts/multimeshfoliagemanager.gd) / [texturearraybatching.gd](scripts/texturearraybatching.gd)
SceneTree overhead at scale Canvas/mesh item spam MANDATORY [renderingserverdirect.gd](scripts/renderingserverdirect.gd)
Main-thread hitch (gen/parse) Sync heavy work MANDATORY [workerthreadpoolmanager.gd](scripts/workerthreadpoolmanager.gd)
Crowd path spikes Nav agents same frame [navigationagentoptimization.gd](scripts/navigationagentoptimization.gd)
Custom game metrics Missing monitors [customperformancemonitor.gd](scripts/customperformancemonitor.gd)

Available Scripts

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

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

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

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

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

RenderingServer canvas/mesh path when SceneTree overhead dominates.

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

Direct space-state queries vs hundreds of RayCast nodes.

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

WorkerThreadPool offload for heavy jobs.

[multimeshoptimizer.gd](scripts/multimeshoptimizer.gd) / [multimeshfoliagemanager.gd](scripts/multimeshfoliagemanager.gd)

Hardware instancing for dense meshes/foliage.

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

Texture2DArray batching to cut material switches.

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

Shared vs local-to-scene memory tradeoffs.

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

Staggered path updates for crowds.

[custommonitorprofiler.gd](scripts/custommonitorprofiler.gd) / [customperformancemonitor.gd](scripts/customperformancemonitor.gd)

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

Expert Pointers (keep short)

  • Compatibility renderer: pre-warm pipelines (hidden camera + unique meshes/materials one frame). Forward+/Mobile: Ubershaders still need instantiate-once detection.
  • VRAM: S3TC/BPTC desktop, ETC2 mobile; skip compression for pixel art.
  • AStar/path budgets belong in [navigationagentoptimization.gd](scripts/navigationagentoptimization.gd) — do not paste thrashy queue snippets as the golden path.

Deep dives (on demand)

  • Path time-slicing, Compatibility shader pre-warm, VRAM codec table → [profiler-budgets-and-prewarm.md](references/profiler-budgets-and-prewarm.md)

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

  • godot-adapt-desktop-to-mobile — resolution/shader fallbacks and battery modes that apply these budgets on weaker GPUs.
  • godot-export-builds — export presets and renderer choices where compression and Compatibility pre-warm matter.
  • godot-genre-open-world — chunk streaming and HLOD systems that consume MultiMesh, culling, and thread-pool patterns at scale.

Master

  • godot-master — library router and mirrored module entry for cross-skill discovery.