godot-performance-optimization
17
总安装量
3
周安装量
#20760
全站排名
安装命令
npx skills add https://github.com/thedivergentai/gd-agentic-skills --skill godot-performance-optimization
Agent 安装分布
opencode
3
gemini-cli
3
codex
3
claude-code
2
github-copilot
2
Skill 文档
Performance Optimization
Profiler-driven analysis, object pooling, and visibility culling define optimized game performance.
Available Scripts
custom_performance_monitor.gd
Manager for adding and updating custom performance monitors in the Godot debugger.
multimesh_foliage_manager.gd
Expert MultiMesh pattern for rendering thousands of foliage instances efficiently.
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.
- NEVER use
print()in release builds âprint()every frame = file I/O bottleneck + log spam. Use@warning_ignoreor conditionalif OS.is_debug_build():. - NEVER ignore
VisibleOnScreenNotifier2Dfor off-screen entities â Enemies processing logic off-screen = wasted CPU. Disableset_process(false)whenscreen_exited. - NEVER instantiate nodes in hot loops â
for i in 1000: var bullet = Bullet.new()= 1000 allocations. Use object pools, reuse instances. - NEVER use
get_node()in_process()â Callingget_node("Player")60x/sec = tree traversal spam. Cache in@onready var player := $Player. - NEVER forget to batch draw calls â 1000 unique sprites = 1000 draw calls. Use TextureAtlas (sprite sheets) + MultiMesh for instanced rendering.
Debug â Profiler (F3)
Tabs:
- Time: Function call times
- Memory: RAM usage
- Network: RPCs, bandwidth
- Physics: Collision checks
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
- Master Skill: godot-master