工具总览:四层观测体系
UE 的性能工具多到让人眼花。按"多快 / 多深"分四层,知道哪层用哪个工具,就不会乱抓。
观测工具的四个层次
| 层次 | 工具 | 回答的问题 | 侵入性 |
|---|---|---|---|
| L1 一眼看 | stat unit / stat fps |
现在卡不卡,谁大致卡 | 零 |
| L2 分系统看 | stat game / stat gpu / stat X 系列 |
哪个系统贵 | 低 |
| L3 帧级深挖 | Unreal Insights | 这一帧里哪个函数 / 哪个任务贵 | 中 |
| L4 外部剖析 | RenderDoc / PIX / 平台原生工具 | GPU 到底在算什么 | 高(建议独立构建) |
使用顺序:永远从 L1 开始 → L2 定位系统 → L3 定位函数 / 任务 → 必要时 L4。从 L3 甚至 L4 起步是新手常犯的错(工具本身的开销会扭曲测量结果)。
stat 家族速查
| 命令 | 看什么 |
|---|---|
stat unit |
三线帧时间(最常用) |
stat fps |
帧率与帧时间 |
stat game |
游戏线程细节 |
stat render / stat rhi |
渲染线程与 RHI 细节 |
stat gpu |
GPU 时间 |
stat memory |
内存分布 |
stat scenerendering |
场景渲染细节(DrawCall 数、可见物体数) |
stat physics / stat ai 等 |
各专项系统 |
Insights:帧级分析的瑞士军刀
Unreal Insights 可以捕捉:
- Timing Insights:每帧每个任务的时间轴(含工作线程并行情况);
- Memory Insights:内存分配跟踪;
- Animation / Networking / Cooking Insights:各专项分析。
启动方法:
UnrealInsights程序 + 编辑器里-trace=...参数 / 或控制台trace.start。详细见 Unreal Insights Trace 快速入门 与 Timing Insights。
