When loading NiagaraSystem, a serious hang occurs. As a result of analysis, there are more than 2000 ObjLoadeds in the EndLoad function of UObjectGlobals.cpp. Because of this part, it seems that a freeze occurs during loading.
EndLoad-Preload:
for (int32 i = 0; i < ObjLoaded.Num(); i++)
{
// Preload.
UObject* Obj = ObjLoaded[i];
if (Obj->HasAnyFlags(RF_NeedLoad))
{
check(Obj->GetLinker());
Obj->GetLinker()->Preload(Obj);
}
}
EndLoad-CondionalPostLoad:
for (int32 i = 0; i < ObjLoaded.Num(); i++)
{
UObject* Obj = ObjLoaded[i];
check(Obj);
#if WITH_EDITOR
if (SlowTask)
{
static const FTextFormat FinalizingTextFormat = NSLOCTEXT("Core", "FinalizingUObject", "Finalizing load of {0}");
SlowTask->EnterProgressFrame(1, FText::Format(FinalizingTextFormat, FText::FromString(Obj->GetName())));
}
#endif
FLinkerLoad* LinkerLoad = Obj->GetLinker();
if (LinkerLoad && LinkerLoad != VisitedLinkerLoad)
{
LinkerLoad->FinishExternalReadDependencies(0.0);
VisitedLinkerLoad = LinkerLoad;
}
Obj->ConditionalPostLoad();
}
}