UE5 Insight ProfileCPU
UE5 Insight简介
UE5 Insight 是虚幻引擎5(Unreal Engine 5)中内置的一套高级性能分析与可视化工具集,旨在帮助开发者实时监控、调试和优化项目性能。它整合了多种分析工具(如Unreal Insights、Stat Commands等),提供数据驱动的洞察力,适用于游戏开发、影视制作或实时3D应用。
Insight使用前构建
独立编译UnrealInsight为exe
Profile CPU
打标签
类似UE4性能Profile的各种方式_ue profile-CSDN博客的SCOPE_CYCLE_COUNTER,不过UnrealInsight的打标签方式相对SCOPE_CYCLE_COUNTER更动态,不用预先声明类型,仅标记字符串就行.
TRACE_CPUPROFILER_EVENT_SCOPE(ULandscapeComponent::PostLoad);
测试代码:
void AMyActor::Test()
{TRACE_CPUPROFILER_EVENT_SCOPE(AMyActor::Test);{TRACE_CPUPROFILER_EVENT_SCOPE(AMyActor::TestAdd);uint64 a = 1;for (int32 Index = 0; Index < 100000000; Index++){a++;}}{TRACE_CPUPROFILER_EVENT_SCOPE(AMyActor::TestMulti);uint64 a = 1;for (int32 Index = 0; Index < 100000000; Index++){a *= 1;}}}
开始录制和结束录制
打开UnrealInsight窗口
选中需要Profile的Trace打开
UnrealInsight查看
火焰图
CPU/GPU过滤出GameThread
在右边搜索想要找的Trace
小功能推荐
推荐搜索栏的两个小功能: 高亮和选择最大消耗
高亮
快速定位到执行最大和最小执行
除此之外还有很多小功能推荐使用,大大提升Profile效率.
参考
UnrealInsight文档 | Epic Developer Community