godot-performance-optimization by thedivergentai/gd-agentic-skills
npx skills add https://github.com/thedivergentai/gd-agentic-skills --skill godot-performance-optimization性能分析器驱动的分析、对象池和可见性剔除共同定义了优化的游戏性能。
将繁重计算卸载到 Godot 4 的 WorkerThreadPool 以实现多线程处理的专家级逻辑。
使用节点可见性和进程切换而非持续实例化的最小化分配策略。
绕过 SceneTree 逻辑,直接通过 RenderingServer 进行大规模 CanvasItem 渲染。
高性能的直接物理空间状态查询,比使用 RayCast 节点进行数百次检查更快。
使用 Performance.get_monitor() 实现实时性能监控以检测瓶颈。
使用 VisibilityNotifier 手动禁用屏幕外逻辑,以剔除 CPU 密集型处理。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
专家级管理 Local-to-Scene 与 Shared 资源,以平衡内存使用和唯一实例状态。
通过利用 TextureArrays 进行基于着色器的多项目批处理,减少绘制调用和状态更改。
通过硬件实例化 (MultiMeshInstance3D) 渲染数千个动画网格实例。
为大规模 AI 群体采用交错路径更新策略,防止单帧内寻路瓶颈。
print() — 每帧都 print() = 文件 I/O 瓶颈 + 日志泛滥。使用 @warning_ignore 或有条件的 if OS.is_debug_build(): [21]。VisibleOnScreenNotifier2D 来处理屏幕外实体 — 敌人在屏幕外处理逻辑 = 浪费 CPU。当 screen_exited 时禁用 set_process(false) [22]。for i in 1000: var bullet = Bullet.new() = 1000 次分配。使用对象池,复用实例 [23]。_process() 中使用 get_node() — 每秒调用 60 次 get_node("Player") = 树遍历泛滥。在 @onready var player := $Player 中缓存 [24]。OS.delay_msec() 或长时间的同步数据处理。使用 WorkerThreadPool 来保持帧率稳定。_inter_ray 或 _physics_process 期间添加/移除节点可能会锁定物理服务器。使用 call_deferred。调试 → 性能分析器 (F3)
选项卡:
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)
# 添加 VisibleOnScreenNotifier2D
# 当离开屏幕时禁用处理
func _on_screen_exited() -> void:
set_process(false)
func _on_screen_entered() -> void:
set_process(true)
# 使用 TextureAtlas (精灵图集)
# 批处理相似材质
# 减少独特纹理数量
每周安装数
71
仓库
GitHub 星标数
70
首次出现
2026年2月10日
安全审计
安装于
opencode68
gemini-cli67
codex67
github-copilot66
kimi-cli66
amp66
Profiler-driven analysis, object pooling, and visibility culling define optimized game performance.
Expert logic for offloading heavy computation to Godot 4's WorkerThreadPool for multi-threaded processing.
Minimal allocation strategy using node visibility and process toggling instead of constant instantiation.
Bypassing the SceneTree logic for massive canvas item rendering directly via the RenderingServer.
High-performance direct physics space state queries, faster than using RayCast nodes for hundreds of checks.
Implementation of real-time performance monitoring using Performance.get_monitor() for bottleneck detection.
Disabling off-screen logic manually using VisibilityNotifiers to cull CPU-heavy processing.
Expert management of Local-to-Scene vs Shared resources to balance memory usage and unique instance states.
Reducing draw calls and state changes by utilizing TextureArrays for multi-item shader-based batching.
Rendering thousands of animated mesh instances via hardware instancing (MultiMeshInstance3D).
Staggered path update strategy for massive AI crowds to prevent pathfinding bottlenecks in a single frame.
print() in release builds — print() every frame = file I/O bottleneck + log spam. Use @warning_ignore or conditional if OS.is_debug_build(): [21].VisibleOnScreenNotifier2D for off-screen entities — Enemies processing logic off-screen = wasted CPU. Disable set_process(false) when screen_exited [22].for i in 1000: var bullet = Bullet.new() = 1000 allocations. Use object pools, reuse instances [23].Debug → Profiler (F3)
Tabs:
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)
# Add VisibleOnScreenNotifier2D
# Disable processing when off-screen
func _on_screen_exited() -> void:
set_process(false)
func _on_screen_entered() -> void:
set_process(true)
# Use TextureAtlas (sprite sheets)
# Batch similar materials
# Fewer unique textures
Weekly Installs
71
Repository
GitHub Stars
70
First Seen
Feb 10, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode68
gemini-cli67
codex67
github-copilot66
kimi-cli66
amp66
Swift Actor 线程安全持久化:构建离线优先应用的编译器强制安全数据层
1,700 周安装
GPUI 布局与样式:Rust 类型安全的 CSS 样式库,Flexbox 布局与链式 API
195 周安装
OpenClaw 环境安全审计员:一键扫描密钥泄露,审计沙箱配置,保障AI技能运行安全
197 周安装
政治科学家分析师技能:应用现实主义、自由主义、建构主义理论框架进行深度政治分析
195 周安装
SEO结构架构专家:优化网站信息架构、标题层次与结构化数据
201 周安装
Elastic Observability SLO管理指南:创建、监控服务等级目标与SLI类型详解
204 周安装
CSS开发指南:Flexbox、Grid布局、响应式设计与性能优化最佳实践
199 周安装
get_node() in _process() — Calling get_node("Player") 60x/sec = tree traversal spam. Cache in @onready var player := $Player [24].OS.delay_msec() or long synchronous data processing. Use WorkerThreadPool to keep framerates steady._inter_ray or _physics_process can lock the physics server. Use call_deferred.