[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KRA90C7EVSEFMA6X8YESJE":3,"skill-same:01M6KRA90C7EVSEFMA6X8YESJE":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":45,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M6KRA90C7EVSEFMA6X8YESJE","godot-optimization",null,"Use when optimizing Godot games — profiler, draw calls, physics tuning, memory management, and common bottlenecks","jame581\u002FGodotPrompter","jame581","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F21112138?v=4","01M6KR3KEQ9Z30WVJRR2E2ZVXE","Jan Mesarč","01M6KR3KJVRMPDSMASQPBCBVK3",964,"MIT","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-optimization\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"Optimization","godot","godot optimization","memory","tuning","common","management","use","memory management","draw","physics","games","calls","profiler","when","2026-11-10 10:12:30",false,"---\nname: godot-optimization\ndescription: Use when optimizing Godot games — profiler, draw calls, physics tuning, memory management, and common bottlenecks\n---\n\n# Godot Optimization\n\nThis skill covers performance optimization for Godot 4.3+ projects in both GDScript and C#. It covers the built-in profiler, draw call reduction, physics tuning, GDScript performance patterns, memory management, object pooling, and a reference table of common bottlenecks.\n\n> **Related skills:** **godot-debugging** for systematic debugging and profiling, **godot-code-review** for performance review checklist, **export-pipeline** for release build optimization, **physics-system** for collision shapes, layers, and physics body types, **2d-essentials** for 2D mesh optimization, particle performance, and draw order tuning, **multithreading** for moving work off the main thread, **mobile-development** for mobile performance budgets.\n\n---\n\n## 1. Using the Profiler\n\n### Frame Time Budget\n\nAt 60 fps, the entire frame (update, physics, rendering) must complete in **16.6 ms**. At 30 fps the budget is 33.3 ms. Any single system that consumes the majority of that budget is a bottleneck.\n\n| Target FPS | Frame budget |\n|---|---|\n| 120 | 8.3 ms |\n| 60 | 16.6 ms |\n| 30 | 33.3 ms |\n\n### Reading Profiler Output\n\nOpen **Debugger > Profiler**, click **Start**, play through the scenario you want to measure, then click **Stop**.\n\n- **Frame Time** — total wall-clock time for that frame in milliseconds.\n- **Self** — time spent inside that function *excluding* callees. This is the primary hotspot indicator. A function with a high Self time is doing expensive work directly.\n- **Total** — time including all callees. Useful for identifying expensive subtrees.\n- **Calls** — call count per frame. A function called thousands of times per frame (even if each call is cheap) can dominate the frame.\n- Click any function name to jump to its source in the script editor.\n\n```gdscript\n# Manual micro-benchmark for a specific block\nvar start := Time.get_ticks_usec()\n_run_expensive_operation()\nvar elapsed := Time.get_ticks_usec() - start\nprint(\"_run_expensive_operation: %d µs\" % elapsed)\n```\n\n**C#:**\n\n```csharp\n\u002F\u002F Manual micro-benchmark using Stopwatch (high-resolution timer)\nusing System.Diagnostics;\n\nvar sw = Stopwatch.StartNew();\nRunExpensiveOperation();\nsw.Stop();\nGD.Print($\"RunExpensiveOperation: {sw.Elapsed.TotalMilliseconds:F3} ms\");\n\n\u002F\u002F Alternative using Godot's built-in timer (microsecond precision)\nlong start = (long)Time.GetTicksUsec();\nRunExpensiveOperation();\nlong elapsed = (long)Time.GetTicksUsec() - start;\nGD.Print($\"RunExpensiveOperation: {elapsed} µs\");\n```\n\n### Monitors Tab\n\n**Debugger > Monitors** shows real-time engine metrics while the game is running. Click a monitor name to open a live graph. Key monitors to watch:\n\n| Monitor | What to watch for |\n|---|---|\n| `Time > FPS` | Below target — frame budget overrun |\n| `Time > Process` | High — `_process()` callbacks are expensive |\n| `Time > Physics Process` | High — `_physics_process()` or physics sim is expensive |\n| `Raster > Total Draw Calls` | Above ~500 (mobile) or ~2 000 (desktop) — needs batching |\n| `Video > Video Mem` | Steadily growing — unfreed textures or meshes (memory leak) |\n| `Object > Objects` | Growing across scene reloads — nodes are not being freed |\n| `Physics 3D > Active Objects` | Large count in simple scenes — bodies not sleeping |\n\n```gdscript\n# Query any monitor at runtime from code\nvar fps := Performance.get_monitor(Performance.TIME_FPS)\nvar draw_calls := Performance.get_monitor(Performance.RENDER_TOTAL_DRAW_CALLS_IN_FRAME)\nvar video_ram := Performance.get_monitor(Performance.RENDER_VIDEO_MEM_USED)\nprint(\"FPS: %d | Draw calls: %d | VRAM: %.1f MB\" % [fps, draw_calls, video_ram \u002F 1_048_576.0])\n```\n\n**C#:**\n\n```csharp\n\u002F\u002F Query any monitor at runtime from code\ndouble fps = Performance.GetMonitor(Performance.Monitor.TimeFps);\ndouble drawCalls = Performance.GetMonitor(Performance.Monitor.RenderTotalDrawCallsInFrame);\ndouble videoRam = Performance.GetMonitor(Performance.Monitor.RenderVideoMemUsed);\nGD.Print($\"FPS: {fps:F0} | Draw calls: {drawCalls:F0} | VRAM: {videoRam \u002F 1_048_576.0:F1} MB\");\n```\n\n---\n\n## 2. Draw Call Optimization\n\nEvery distinct mesh, sprite, or canvas item that cannot be batched with its neighbours costs one draw call. Reducing draw calls is one of the highest-leverage optimisations, especially on mobile. 2D batching is automatic (Compatibility; Forward+\u002FMobile from 4.4) while neighbouring items share texture and material — so atlas sprites, keep unique-material count low, and cull off-screen work. `CanvasGroup` does not batch: it renders its children to a backbuffer.\n\n> See [references\u002Fdraw-calls.md](references\u002Fdraw-calls.md) for the full recipes (2D batch-breaking rules, shared materials with per-instance uniforms, texture atlases, `VisibleOnScreenNotifier2D\u002F3D` culling, and 3D LOD swapping).\n\n---\n\n## 3. Physics Optimization\n\nPhysics tuning hinges on minimising broadphase work and avoiding mesh colliders on moving bodies. Trim collision masks to only the layers each body actually needs, replace `ConcavePolygonShape3D` with primitives on anything that moves, and prefer `Area2D\u002F3D` over per-frame raycasts for overlap detection.\n\n> See [references\u002Fphysics-tuning.md](references\u002Fphysics-tuning.md) for the full recipes (layer\u002Fmask bit examples, collision-shape cost table, `Engine.physics_ticks_per_second` tuning, Area-vs-raycast patterns).\n\n---\n\n## 4. GDScript Performance\n\nHot-path GDScript wins come from eliminating per-frame allocations, comparing `StringName` instead of `String`, using typed arrays \u002F `PackedArray`s, and `preload`-ing resources at class scope. The same allocation discipline applies to C# (with `List\u003CT>` in place of typed `Array[T]` and `static readonly StringName` fields).\n\n> See [references\u002Fcpu-bottlenecks.md](references\u002Fcpu-bottlenecks.md) for the full recipes (cached group queries, reused vector locals, `&\"...\"` literals, `PackedVector2Array`, static typing, `preload` vs `load`, plus C# parity blocks).\n\n---\n\n## 5. Memory Management\n\nWatch `Performance.MEMORY_STATIC` and `OBJECT_COUNT` across scene reloads — steady growth means leaked references. Resources loaded by path are cached and shared; call `.duplicate()` when you need per-instance mutation. Always prefer `queue_free()` for nodes; `free()` on a node that is emitting a signal is refused in the editor and debug exports (\"Object is locked and can't be freed\"), but release exports skip that check and free it mid-emission (undefined behaviour).\n\n> See [references\u002Fmemory-management.md](references\u002Fmemory-management.md) for the full recipes (Performance singleton queries, ResourceLoader cache semantics, `queue_free` vs `free` table, plus the full GDScript and C# **object pool** implementations for bullets\u002Feffects\u002Fparticles).\n\n---\n\n## 6. Common Bottlenecks\n\n| Problem | Diagnosis tool | Fix |\n|---|---|---|\n| Too many draw calls | Debugger > Monitors `Raster > Total Draw Calls`; Viewport > Debug > Draw Calls overlay | Keep 2D neighbours on one texture and material so they batch; `MultiMeshInstance3D` or merged meshes for 3D; use texture atlases; reduce unique materials |\n| Heavy GDScript in `_process` | Profiler > Self column shows script functions at top | Move logic to `_physics_process` (fixed 60 ticks\u002Fs by default — less often than `_process` at high frame rates), cache queries, avoid per-frame allocations, consider C# for tight loops |\n| Excessive signal connections | Profiler shows signal dispatch overhead; manually audit `get_signal_connection_list()` | Remove redundant connections; prefer polling over per-frame signals for high-frequency data; use `CONNECT_ONE_SHOT` for fire-and-forget |\n| Unoptimised TileMap | High draw call count while the map is on screen | Split into fewer layers; use a single atlas texture per layer; use `TileMapLayer` (Godot 4.3+) instead of legacy TileMap |\n| Large uncompressed textures | Monitors `Video > Video Mem` is high; check Import dock for texture settings | Enable texture compression (VRAM Compressed) in the Import dock; use mipmaps; halve resolution of assets not viewed up-close |\n| Too many active physics bodies | Monitors `Physics 3D > Active Objects` is high; slow `_physics_process` in Profiler | Enable sleeping on `RigidBody3D` (`can_sleep = true`); lower physics tick rate; replace distant bodies with fake animations; use layers\u002Fmasks to narrow collision checks |\n| String operations in hot paths | Profiler Self time in string-heavy functions; in C#, frequent GC pauses | Replace `String` comparisons with `StringName` (`&\"...\"`); avoid `String` formatting in `_process`; build strings once and cache |\n| `instantiate()` in hot paths | Profiler shows `PackedScene.instantiate` with high Self time (enable Editor Settings > Debugger > Profile Native Calls) | Implement object pooling (see `references\u002Fmemory-management.md`); preload scenes at startup; spawn during loading screens rather than during gameplay |\n\n---\n\n## 7. Top Anti-Patterns\n\n- **Allocating in `_process`** — new Arrays, Dictionaries, Strings, or Vector constructors per frame. Cache the container, mutate fields in place. See [references\u002Fcpu-bottlenecks.md](references\u002Fcpu-bottlenecks.md).\n- **Mesh colliders on moving bodies** — `ConcavePolygonShape3D` on a `CharacterBody3D` or `RigidBody3D`. Use a capsule, box, or convex hull instead. See [references\u002Fphysics-tuning.md](references\u002Fphysics-tuning.md).\n- **Unique materials per instance** — `material_override = SomeMaterial.new()` in `_ready()` breaks batching. Share one material; vary via shader parameters. See [references\u002Fdraw-calls.md](references\u002Fdraw-calls.md).\n- **`load()` in hot paths** — calling `load(\"res:\u002F\u002F...\")` from `_process` or `_physics_process`. Use `const X := preload(...)` at class scope. See [references\u002Fcpu-bottlenecks.md](references\u002Fcpu-bottlenecks.md).\n- **`instantiate()` + `queue_free()` for short-lived objects** — bullets, hit effects, particles. Pool them. See [references\u002Fmemory-management.md](references\u002Fmemory-management.md).\n\n---\n\n## 8. Checklist\n\nWork through this list before shipping or when investigating a performance complaint.\n\n**Profiler**\n- [ ] Run the Profiler during the most demanding gameplay scenario.\n- [ ] Confirm no single function's Self time exceeds 30% of the frame budget.\n- [ ] Confirm total frame time stays under budget (16.6 ms at 60 fps).\n\n**Draw Calls**\n- [ ] Draw call count is within target (≤500 mobile, ≤2 000 desktop).\n- [ ] 2D sprites drawn next to each other share one atlas texture and material, so they batch.\n- [ ] Textures are atlas-packed where possible; duplicate materials are eliminated.\n- [ ] Off-screen nodes use `VisibleOnScreenNotifier2D\u002F3D` to pause processing.\n- [ ] 3D meshes have LOD enabled via import settings or manual swap logic.\n\n**Physics**\n- [ ] Collision layers and masks are minimal — no body checks layers it never needs.\n- [ ] No moving body uses `ConcavePolygonShape` — replaced with capsule, box, or convex.\n- [ ] Physics tick rate is appropriate for the game type (30 Hz may be fine for turn-based or top-down).\n- [ ] `Area2D\u002F3D` is used for overlap detection instead of per-frame raycasts.\n- [ ] `RigidBody3D` nodes have `can_sleep = true` where applicable.\n\n**GDScript**\n- [ ] No `Array`, `Dictionary`, or `String` is allocated inside `_process` or `_physics_process`.\n- [ ] All hot-path string comparisons use `StringName` (`&\"...\"`).\n- [ ] All arrays in hot paths are typed (`Array[T]` or `PackedArray`).\n- [ ] All function parameters and return types in hot paths are statically typed.\n- [ ] All scene and resource references use `preload` at class scope, not `load` per frame.\n\n**Memory**\n- [ ] `Performance.get_monitor(Performance.MEMORY_STATIC)` is stable between scene reloads.\n- [ ] Resources that require per-instance mutation are `.duplicate()`d.\n- [ ] All node removals use `queue_free()` unless synchronous teardown is explicitly required.\n\n**Object Pooling**\n- [ ] Bullets, hit effects, particles, and other frequently spawned objects use a pool.\n- [ ] Pool initial size is large enough to avoid runtime growth during normal gameplay.\n- [ ] Pooled objects reset all state on reactivation (position, velocity, signals).\n","# Godot Optimization\n\nThis skill covers performance optimization for Godot 4.3+ projects in both GDScript and C#. It covers the built-in profiler, draw call reduction, physics tuning, GDScript performance patterns, memory management, object pooling, and a reference table of common bottlenecks.\n\n> **Related skills:** **godot-debugging** for systematic debugging and profiling, **godot-code-review** for performance review checklist, **export-pipeline** for release build optimization, **physics-system** for collision shapes, layers, and physics body types, **2d-essentials** for 2D mesh optimization, particle performance, and draw order tuning, **multithreading** for moving work off the main thread, **mobile-development** for mobile performance budgets.\n\n---\n\n## 1. Using the Profiler\n\n### Frame Time Budget\n\nAt 60 fps, the entire frame (update, physics, rendering) must complete in **16.6 ms**. At 30 fps the budget is 33.3 ms. Any single system that consumes the majority of that budget is a bottleneck.\n\n| Target FPS | Frame budget |\n|---|---|\n| 120 | 8.3 ms |\n| 60 | 16.6 ms |\n| 30 | 33.3 ms |\n\n### Reading Profiler Output\n\nOpen **Debugger > Profiler**, click **Start**, play through the scenario you want to measure, then click **Stop**.\n\n- **Frame Time** — total wall-clock time for that frame in milliseconds.\n- **Self** — time spent inside that function *excluding* callees. This is the primary hotspot indicator. A function with a high Self time is doing expensive work directly.\n- **Total** — time including all callees. Useful for identifying expensive subtrees.\n- **Calls** — call count per frame. A function called thousands of times per frame (even if each call is cheap) can dominate the frame.\n- Click any function name to jump to its source in the script editor.\n\n```gdscript\n# Manual micro-benchmark for a specific block\nvar start := Time.get_ticks_usec()\n_run_expensive_operation()\nvar elapsed := Time.get_ticks_usec() - start\nprint(\"_run_expensive_operation: %d µs\" % elapsed)\n```\n\n**C#:**\n\n```csharp\n\u002F\u002F Manual micro-benchmark using Stopwatch (high-resolution timer)\nusing System.Diagnostics;\n\nvar sw = Stopwatch.StartNew();\nRunExpensiveOperation();\nsw.Stop();\nGD.Print($\"RunExpensiveOperation: {sw.Elapsed.TotalMilliseconds:F3} ms\");\n\n\u002F\u002F Alternative using Godot's built-in timer (microsecond precision)\nlong start = (long)Time.GetTicksUsec();\nRunExpensiveOperation();\nlong elapsed = (long)Time.GetTicksUsec() - start;\nGD.Print($\"RunExpensiveOperation: {elapsed} µs\");\n```\n\n### Monitors Tab\n\n**Debugger > Monitors** shows real-time engine metrics while the game is running. Click a monitor name to open a live graph. Key monitors to watch:\n\n| Monitor | What to watch for |\n|---|---|\n| `Time > FPS` | Below target — frame budget overrun |\n| `Time > Process` | High — `_process()` callbacks are expensive |\n| `Time > Physics Process` | High — `_physics_process()` or physics sim is expensive |\n| `Raster > Total Draw Calls` | Above ~500 (mobile) or ~2 000 (desktop) — needs batching |\n| `Video > Video Mem` | Steadily growing — unfreed textures or meshes (memory leak) |\n| `Object > Objects` | Growing across scene reloads — nodes are not being freed |\n| `Physics 3D > Active Objects` | Large count in simple scenes — bodies not sleeping |\n\n```gdscript\n# Query any monitor at runtime from code\nvar fps := Performance.get_monitor(Performance.TIME_FPS)\nvar draw_calls := Performance.get_monitor(Performance.RENDER_TOTAL_DRAW_CALLS_IN_FRAME)\nvar video_ram := Performance.get_monitor(Performance.RENDER_VIDEO_MEM_USED)\nprint(\"FPS: %d | Draw calls: %d | VRAM: %.1f MB\" % [fps, draw_calls, video_ram \u002F 1_048_576.0])\n```\n\n**C#:**\n\n```csharp\n\u002F\u002F Query any monitor at runtime from code\ndouble fps = Performance.GetMonitor(Performance.Monitor.TimeFps);\ndouble drawCalls = Performance.GetMonitor(Performance.Monitor.RenderTotalDrawCallsInFrame);\ndouble videoRam = Performance.GetMonitor(Performance.Monitor.RenderVideoMemUsed);\nGD.Print($\"FPS: {fps:F0} | Draw calls: {drawCalls:F0} | VRAM: {videoRam \u002F 1_048_576.0:F1} MB\");\n```\n\n---\n\n## 2. Draw Call Optimization\n\nEvery distinct mesh, sprite, or canvas item that cannot be batched with its neighbours costs one draw call. Reducing draw calls is one of the highest-leverage optimisations, especially on mobile. 2D batching is automatic (Compatibility; Forward+\u002FMobile from 4.4) while neighbouring items share texture and material — so atlas sprites, keep unique-material count low, and cull off-screen work. `CanvasGroup` does not batch: it renders its children to a backbuffer.\n\n> See [references\u002Fdraw-calls.md](references\u002Fdraw-calls.md) for the full recipes (2D batch-breaking rules, shared materials with per-instance uniforms, texture atlases, `VisibleOnScreenNotifier2D\u002F3D` culling, and 3D LOD swapping).\n\n---\n\n## 3. Physics Optimization\n\nPhysics tuning hinges on minimising broadphase work and avoiding mesh colliders on moving bodies. Trim collision masks to only the layers each body actually needs, replace `ConcavePolygonShape3D` with primitives on anything that moves, and prefer `Area2D\u002F3D` over per-frame raycasts for overlap detection.\n\n> See [references\u002Fphysics-tuning.md](references\u002Fphysics-tuning.md) for the full recipes (layer\u002Fmask bit examples, collision-shape cost table, `Engine.physics_ticks_per_second` tuning, Area-vs-raycast patterns).\n\n---\n\n## 4. GDScript Performance\n\nHot-path GDScript wins come from eliminating per-frame allocations, comparing `StringName` instead of `String`, using typed arrays \u002F `PackedArray`s, and `preload`-ing resources at class scope. The same allocation discipline applies to C# (with `List\u003CT>` in place of typed `Array[T]` and `static readonly StringName` fields).\n\n> See [references\u002Fcpu-bottlenecks.md](references\u002Fcpu-bottlenecks.md) for the full recipes (cached group queries, reused vector locals, `&\"...\"` literals, `PackedVector2Array`, static typing, `preload` vs `load`, plus C# parity blocks).\n\n---\n\n## 5. Memory Management\n\nWatch `Performance.MEMORY_STATIC` and `OBJECT_COUNT` across scene reloads — steady growth means leaked references. Resources loaded by path are cached and shared; call `.duplicate()` when you need per-instance mutation. Always prefer `queue_free()` for nodes; `free()` on a node that is emitting a signal is refused in the editor and debug exports (\"Object is locked and can't be freed\"), but release exports skip that check and free it mid-emission (undefined behaviour).\n\n> See [references\u002Fmemory-management.md](references\u002Fmemory-management.md) for the full recipes (Performance singleton queries, ResourceLoader cache semantics, `queue_free` vs `free` table, plus the full GDScript and C# **object pool** implementations for bullets\u002Feffects\u002Fparticles).\n\n---\n\n## 6. Common Bottlenecks\n\n| Problem | Diagnosis tool | Fix |\n|---|---|---|\n| Too many draw calls | Debugger > Monitors `Raster > Total Draw Calls`; Viewport > Debug > Draw Calls overlay | Keep 2D neighbours on one texture and material so they batch; `MultiMeshInstance3D` or merged meshes for 3D; use texture atlases; reduce unique materials |\n| Heavy GDScript in `_process` | Profiler > Self column shows script functions at top | Move logic to `_physics_process` (fixed 60 ticks\u002Fs by default — less often than `_process` at high frame rates), cache queries, avoid per-frame allocations, consider C# for tight loops |\n| Excessive signal connections | Profiler shows signal dispatch overhead; manually audit `get_signal_connection_list()` | Remove redundant connections; prefer polling over per-frame signals for high-frequency data; use `CONNECT_ONE_SHOT` for fire-and-forget |\n| Unoptimised TileMap | High draw call count while the map is on screen | Split into fewer layers; use a single atlas texture per layer; use `TileMapLayer` (Godot 4.3+) instead of legacy TileMap |\n| Large uncompressed textures | Monitors `Video > Video Mem` is high; check Import dock for texture settings | Enable texture compression (VRAM Compressed) in the Import dock; use mipmaps; halve resolution of assets not viewed up-close |\n| Too many active physics bodies | Monitors `Physics 3D > Active Objects` is high; slow `_physics_process` in Profiler | Enable sleeping on `RigidBody3D` (`can_sleep = true`); lower physics tick rate; replace distant bodies with fake animations; use layers\u002Fmasks to narrow collision checks |\n| String operations in hot paths | Profiler Self time in string-heavy functions; in C#, frequent GC pauses | Replace `String` comparisons with `StringName` (`&\"...\"`); avoid `String` formatting in `_process`; build strings once and cache |\n| `instantiate()` in hot paths | Profiler shows `PackedScene.instantiate` with high Self time (enable Editor Settings > Debugger > Profile Native Calls) | Implement object pooling (see `references\u002Fmemory-management.md`); preload scenes at startup; spawn during loading screens rather than during gameplay |\n\n---\n\n## 7. Top Anti-Patterns\n\n- **Allocating in `_process`** — new Arrays, Dictionaries, Strings, or Vector constructors per frame. Cache the container, mutate fields in place. See [references\u002Fcpu-bottlenecks.md](references\u002Fcpu-bottlenecks.md).\n- **Mesh colliders on moving bodies** — `ConcavePolygonShape3D` on a `CharacterBody3D` or `RigidBody3D`. Use a capsule, box, or convex hull instead. See [references\u002Fphysics-tuning.md](references\u002Fphysics-tuning.md).\n- **Unique materials per instance** — `material_override = SomeMaterial.new()` in `_ready()` breaks batching. Share one material; vary via shader parameters. See [references\u002Fdraw-calls.md](references\u002Fdraw-calls.md).\n- **`load()` in hot paths** — calling `load(\"res:\u002F\u002F...\")` from `_process` or `_physics_process`. Use `const X := preload(...)` at class scope. See [references\u002Fcpu-bottlenecks.md](references\u002Fcpu-bottlenecks.md).\n- **`instantiate()` + `queue_free()` for short-lived objects** — bullets, hit effects, particles. Pool them. See [references\u002Fmemory-management.md](references\u002Fmemory-management.md).\n\n---\n\n## 8. Checklist\n\nWork through this list before shipping or when investigating a performance complaint.\n\n**Profiler**\n- [ ] Run the Profiler during the most demanding gameplay scenario.\n- [ ] Confirm no single function's Self time exceeds 30% of the frame budget.\n- [ ] Confirm total frame time stays under budget (16.6 ms at 60 fps).\n\n**Draw Calls**\n- [ ] Draw call count is within target (≤500 mobile, ≤2 000 desktop).\n- [ ] 2D sprites drawn next to each other share one atlas texture and material, so they batch.\n- [ ] Textures are atlas-packed where possible; duplicate materials are eliminated.\n- [ ] Off-screen nodes use `VisibleOnScreenNotifier2D\u002F3D` to pause processing.\n- [ ] 3D meshes have LOD enabled via import settings or manual swap logic.\n\n**Physics**\n- [ ] Collision layers and masks are minimal — no body checks layers it never needs.\n- [ ] No moving body uses `ConcavePolygonShape` — replaced with capsule, box, or convex.\n- [ ] Physics tick rate is appropriate for the game type (30 Hz may be fine for turn-based or top-down).\n- [ ] `Area2D\u002F3D` is used for overlap detection instead of per-frame raycasts.\n- [ ] `RigidBody3D` nodes have `can_sleep = true` where applicable.\n\n**GDScript**\n- [ ] No `Array`, `Dictionary`, or `String` is allocated inside `_process` or `_physics_process`.\n- [ ] All hot-path string comparisons use `StringName` (`&\"...\"`).\n- [ ] All arrays in hot paths are typed (`Array[T]` or `PackedArray`).\n- [ ] All function parameters and return types in hot paths are statically typed.\n- [ ] All scene and resource references use `preload` at class scope, not `load` per frame.\n\n**Memory**\n- [ ] `Performance.get_monitor(Performance.MEMORY_STATIC)` is stable between scene reloads.\n- [ ] Resources that require per-instance mutation are `.duplicate()`d.\n- [ ] All node removals use `queue_free()` unless synchronous teardown is explicitly required.\n\n**Object Pooling**\n- [ ] Bullets, hit effects, particles, and other frequently spawned objects use a pool.\n- [ ] Pool initial size is large enough to avoid runtime growth during normal gameplay.\n- [ ] Pooled objects reset all state on reactivation (position, velocity, signals).\n",{"name":5,"description":7},"master","d7b26cdb5fae14d4ef7b713c5bf259395e75c3c6","skills\u002Fgodot-optimization",63,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter","https:\u002F\u002Fgithub.com\u002Fjame581","https:\u002F\u002Fjanmesarc.online\u002F","Software engineer. My biggest passion is game development.","2026-11-14 20:45:49",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add jame581\u002FGodotPrompter --skill godot-optimization",{"tool":54,"command":55},"bunx","bunx skills add jame581\u002FGodotPrompter --skill godot-optimization",{"tool":57,"command":58},"pnpm","pnpm dlx skills add jame581\u002FGodotPrompter --skill godot-optimization","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-optimization\u002FSKILL.md",true,[62,68,72,76],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fcpu-bottlenecks.md","REFERENCE","参考文档",9335,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-optimization\u002Freferences\u002Fcpu-bottlenecks.md",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fdraw-calls.md",7585,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-optimization\u002Freferences\u002Fdraw-calls.md",{"path":73,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fmemory-management.md",10775,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-optimization\u002Freferences\u002Fmemory-management.md",{"path":77,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fphysics-tuning.md",5479,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fgodot-optimization\u002Freferences\u002Fphysics-tuning.md",[81,100,121,151,175,192],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":34},"01M6KRFE5BR2PSD08ZKDAS66R7","xr-development","Use when building VR\u002FAR\u002FXR applications — OpenXR setup, XROrigin3D, hand tracking, controllers, passthrough, and Meta Quest deployment in Godot 4.3+","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fxr-development\u002FSKILL.md",[],[88,89,33,90,20,91,92,93,94,95,96,26,97,98,99],"xr development","development","deployment","vr","setup","tracking","godot 4","ar","hand","Meta","applications","quest",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":34},"01M6KRF8GZTG1TAS506MFBSGFC","web-services","Use when a Godot game calls a web server — HTTPRequest, downloads, REST\u002FJSON APIs, auth headers, WebSocketPeer clients, TLS, retries, and keeping secrets out of the build. Not for game networking\u002FRPCs (multiplayer-basics) or browser export (web-export)","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-services\u002FSKILL.md",[],[107,108,109,110,111,112,113,114,26,33,20,115,116,117,118,119,120],"web services","web","services","tls","retries","calling","auth","downloads","clients","headers","secrets","json","build","REST",{"skillNo":122,"name":123,"nameZh":6,"description":124,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":125,"categories":126,"keywords":132,"publishedAt":34},"01M6KRF38Q4WSKAYFS56PG87T0","web-export","Use when shipping a Godot game to the browser — Web export preset options, threads vs no-threads and COOP\u002FCOEP headers, hosting on itch.io or your own server, PWA, JavaScriptBridge, user:\u002F\u002F persistence, audio and input limits, and load size","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-export\u002FSKILL.md",[127],{"categoryNo":128,"categoryName":129,"taxonomyType":130,"taxonomyTypeDesc":131},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[108,133,134,135,136,137,138,139,116,140,141,33,142,143,144,145,146,147,26,148,149,150],"export","web export","threads","limits","shipping","size","options","hosting","input","Coop","preset","browser","game","io","load","pwa","Audio","server",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":165,"publishedAt":34},"01M6KREYFETEBH62ZTN6EZH2X3","using-godot-prompter","Bootstrap skill — establishes how to find and use GodotPrompter skills, with platform-specific tool mapping","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fusing-godot-prompter\u002FSKILL.md",[157,160],{"categoryNo":158,"categoryName":159,"taxonomyType":130,"taxonomyTypeDesc":131},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":161,"categoryName":162,"taxonomyType":163,"taxonomyTypeDesc":164},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[20,166,167,168,169,26,170,171,172,173,174],"using godot prompter","find","with","bootstrap","tool","platform","mapping","how","how to",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"publishedAt":34},"01M6KRER5G7EQWKGAFN8QJKQ69","tween-animation","Use when implementing tweens — property animation, method tweening, chaining, parallel sequences, easing, and common UI\u002Fgameplay motion recipes","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Ftween-animation\u002FSKILL.md",[],[182,183,26,184,185,186,187,188,189,24,190,33,191],"tween animation","Animation","motion","parallel","gameplay","chaining","ui","recipes","implementing","sequences",{"skillNo":193,"name":194,"nameZh":6,"description":195,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":196,"categories":197,"keywords":198,"publishedAt":34},"01M6KREKGCQMVDV8WX7HWX8BZG","state-machine","Use when building a state machine or refactoring logic into one — enum, node, and resource-based FSM patterns with trade-offs. Not for adding states to an existing one","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fstate-machine\u002FSKILL.md",[],[199,200,201,20,33,202,203,204,205,206,168,26,190,207],"state","state machine","machine","patterns","node","fsm","state machines","trade","trade-offs"]