Godot performance optimization

From nix-community/nur-combined · View interactive version

Godot performance optimization is an AI agent skill from the GitHub repository nix-community/nur-combined. 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

Performance Optimization

Profiler-driven analysis, object pooling, and visibility culling define optimized game performance.

Available Scripts

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

Expert logic for offloading heavy computation to Godot 4's WorkerThreadPool for multi-threaded processing.

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

Minimal allocation strategy using node visibility and process toggling instead of constant instantiation.

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

Bypassing the SceneTree logic for massive canvas item rendering directly via the RenderingServer.

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

High-performance direct physics space state queries, faster than using RayCast nodes for hundreds of checks.

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

Implementation of real-time performance monitoring using Performance.get_monitor() for bottleneck detection.

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

Disabling off-screen logic manually using VisibilityNotifiers to cull CPU-heavy processing.

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

Expert management of Local-to-Scene vs Shared resources to balance memory usage and unique instance states.

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

Reducing draw calls and state changes by utilizing TextureArrays for multi-item shader-based batching.

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

Rendering thousands of animated mesh instances via hardware instancing (MultiMeshInstance3D).

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

Staggered path update strategy for massive AI crowds to prevent pathfinding bottlenecks in a single frame.

NEVER Do in Performance Optimization


Debug → Profiler (F3)

Tabs:

Common Optimizations

Object Pooling

var bullet_pool: Array[Node] = []

func get_bullet() -> Node:
    if bullet_pool.is_empty():
        return Bullet.new()
    return bullet_pool.pop_back()

func return_bullet(bullet: Node) -> void:
    bullet.hide()
    bullet_pool.append(bullet)

Visibility Notifier

# Add VisibleOnScreenNotifier2D
# Disable processing when off-screen
func _on_screen_exited() -> void:
    set_process(false)

func _on_screen_entered() -> void:
    set_process(true)

Reduce Draw Calls

# Use TextureAtlas (sprite sheets)
# Batch similar materials
# Fewer unique textures

Reference

Related

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.