Why do I get this warning message on load stream level?

The message is this: “LogLevel: Warning: SortActorsHierarchy(/Game/Maps/UEDPIE_0_City_02_Map) took 101.610619 seconds”

The map City_02_Map has 50.000 actors. What does the function SortActorsHierarchy?

Thanks!

Check it for yourself

https://github.com/EpicGames/UnrealEngine/blob/1d2c1e48bf49836a4fee1465be87ab3f27d5ae3a/Engine/Source/Runtime/Engine/Private/Level.cpp#L824

It’s described: “Sorts actors such that parent actors will appear before children actors in the list”

It seems to sort actors based geological tree of actors. Note that “parent actor” is same as “parent class”. “parent actor” is usally a actor that spawned actor but in code any actor can be set as parent, so fot example you know to whom the projectile that killed some enemy belongs to and who should get points for it

Based on code this warning shows up if this code is executed in more then 1 secound

It takes many seconds in my project to run (101 seconds to order the actors).Can it be optimized?

Is this function executed in production build? or only in debug mode?

I dont see any filtring, so it will show in all build as long as logs are enabled

It might not be issue, but rether consequence of 50k actors on level, but if you stream this might be a issue. Test if you have any freezes in rendering while level is loaded