[Level Instances]: Editor Actor Folders does a full refresh after any LI is loaded, leading to wasted time when bulk loading LIs for a given WP region load

We discovered a pretty big performance hit in editor when loading level instances for a world partition map, specifically:

EditorActorFolders.cpp:

  • FActorFolders::OnAllLevelsChanged()
    • this method gets called any time an LI is loaded in the editor
    • this method will do housekeeping and a full rebuild of the folder list for the world (expensive)
    • This method will also get called multiple times for nested LIs, which adds to the cost of nested LIs impacting load times.

Proposed optimization:

  • We added a global variable in a WITH_EDITOR block, for GIsBulkLoadingLevelInstances
  • Within LevelInstanceSubsystem.cpp, add a TGuardValue<bool> to flip it on when doing bulk loading of LevelInstancesToLoadOrUpdateCopy
  • After bulk loading is completed, broadcast an event & bind OnAllLevelsChanged to that event, so it can run the rebuild once.

Making this change on our end showed savings of between 40-60% for loading of level instances for out large/dense maps.

+1 We have a similar engine divergence and it saves literally minutes in loading our main level in the editor.

Hello,

Thanks for raising this! I created a JIRA for us to look into it further. I don’t have an ETA as priorities for bugs and features can shift at any time.

p.s. Epic employees will be out of the office for the next couple of weeks (6/30 - 7/11) and won’t be able to respond during that period.

Thanks,

Ryan

Note: This also impacts unloading regions in the WP map as well, any time an LI is unloaded it will trigger the same rebuild of the whole editor actor folders.