In editor, WorldDataLayers acceleration table used to map DL Names to DL instances is not created. The main reason was to avoid to handle all the case where it would need to be updated.
When UDataLayerManager::Initialize() calls this code:
// Manually call OnActorDescContainerInstanceInitialized on already initialized outer world partition container instances OuterWorldPartition->ForEachActorDescContainerInstance([this](UActorDescContainerInstance* ActorDescContainerInstance) { OnActorDescContainerInstanceInitialized(ActorDescContainerInstance); }, true);
AWorldDataLayers::GetDataLayerInstanceFromAssetName ends up being called a lot and is slow because of the linear search / string comparisons.
A licensee proposes to temporarily build the cache before this call and flush it after like so:
// Hacked code - temporarily initialize acceleration tableForEachDataLayerInstance([](const UDataLayerInstance* DataLayerInstance) { UpdateAccelerationTable(DataLayerInstance, true); }); // Existing Code OuterWorldPartition->ForEachActorDescContainerInstance([this](UActorDescContainerInstance* ActorDescContainerInstance) { OnActorDescContainerInstanceInitialized(ActorDescContainerInstance); }, true); // Hacked code - wipe out temporary table ClearAccelerationTable();
Licensee says that when doing this, the time spent in UDataLayerManager::Initialize goes from 23s to 150ms.
Check whether this is good enough and/or add support of the acceleration table(s) in editor.
Project needs :
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-260202 in the post.