voidUMaterialInstance::Serialize(FArchive&Ar){SCOPE_CYCLE_COUNTER(STAT_MaterialInstance_Serialize);// dosomething() } 2. DECLARE_SCOPE_CYCLE_COUNTER,相比SCOPE_CYCLE_COUNTER使用更简便一些,单由于要动态生成stat id,会引入更多的性能开销,使用方法如下: DECLARE_SCOPE_CYCLE_COUNTER(TEXT("UnhashUnreachableObjec...
1. 声明一个Stat组,声明一个Stat。 2. 在函数中,调用SCOPE_CYCLE_COUNTER宏,填入我们声明的Stat。 #if STATSDECLARE_STATS_GROUP(TEXT("UBulletEffectModule"),STATGROUP_UBulletEffectModule,STATCAT_Advanced);DECLARE_CYCLE_STAT(TEXT("UBulletEffectModule InitBulletEffect"),STAT_UBulletEffectModule_Init,STAT...
在图一中可以看到性能监测界面出现一行数据,MyActorTick。 SCOPE_CYCLE_COUNTER(STAT_Tick); 在具体需要监测的代码使用该宏,参数为第二个宏中定义的监控Key值。 (图三)相关实现代码
{ SCOPE_CYCLE_COUNTER(STAT_CharUpdateAcceleration); // We need to check the jump state before adjusting input acceleration, to minimize latency // and to make sure acceleration respects our potentially new falling state. CharacterOwner->CheckJumpInput(DeltaTime); // apply input to acceleration Ac...
SCOPE_CYCLE_COUNTER(STAT_UpdatePrimitiveTransformGT); SCOPED_NAMED_EVENT(FScene_UpdatePrimitiveTransform, FColor::Yellow);//Save the world transform for next time the primitive is added to the sceneconstfloatWorldTime = GetWorld()->GetTimeSeconds();floatDeltaTime = WorldTime - Primitive->LastSub...
CONDITIONAL_SCOPE_CYCLE_COUNTER(STAT_BlueprintTime, IsInGameThread() && BlueprintExceptionTracker.ScriptEntryTag == 1); #endif #if TOTAL_OVERHEAD_SCRIPT_STATS FBlueprintEventTimer::FScopedVMTimer VMTime; #endif // TOTAL_OVERHEAD_SCRIPT_STATS ...
SCOPE_CYCLE_COUNTER:监听函数性能消耗 Step 1: 定义Stat群组: 建议可放在PCH.h中 or *.module.h 中 DECLARE_STATS_GROUP(TEXT("Display Name"), STATGROUP_群组名称, STATCAT_Advanced); Step 2: 定义埋点: 埋点所属的群组名称为Step 1定义的或已经存在的群组:如STATGROUP_Collision ...
SCOPE_CYCLE_COUNTER(STAT_CharUpdateAcceleration); // We need to check the jump state before adjusting input acceleration, to minimize latency // and to make sure acceleration respects our potentially new falling state. CharacterOwner->CheckJumpInput(DeltaTime); ...
GetComponents获取到所有的组件 初始化他们voidAActor::InitializeComponents(){QUICK_SCOPE_CYCLE_COUNTER(STAT_Actor_InitializeComponents);TInlineComponentArray<UActorComponent*>Components;GetComponents(Components);for(UActorComponent*ActorComp:Components){if(ActorComp->IsRegistered()){if(ActorComp->bAutoActivat...