Taking another look at the 5.4 code, I see what you mean now. I think the first thing to try here is to profile this deletion code in a bit more detail to see if we can narrow down what parts are taking so long to complete. I would recommend using visual studios built in sampling profiler for this. You can access this from the Debug menu:
[Image Removed]Make sure your content is cooked, set your solution configuration to whatever you last cooked (Development, Test, or Shipping), enable the CPU usage profiling and click start.
[Image Removed]Since this profiler uses sampling to determine how long is spent in each section of the codebase, running this for longer will produce more accurate results. You can also increase the sample rate in the settings (cog wheel in above screenshot). Once you’ve finished the profile and visual studio has generated the report, click on the `Open Details` link.
[Image Removed]Select Functions from the current view dropdown
[Image Removed]Type DeleteSceneRenderers into the search box in the top right corner and hit enter
[Image Removed]Once you’ve found the function in the list, right click on it and select: View in Caller/Callee
[Image Removed]This should give you a view like the following that you can then use to drill down into which parts of the deletion code are taking the longest. Here I see that in my blank project example the actual FDeferredShadingSceneRenderer destructor is taking the longest (I only have 24 samples in this profile, so this might not be super accurate).
[Image Removed]I can then click on this function to drill down further. Drilling down the hot path far enough, I can see that, for me, the cleanup of RayTracingMeshBatchTaskPages is taking the longest. This is just a blank project though, and my DeleteSceneRenderer time measured in insights is only 85us, so I would expect your results to be quite different.
[Image Removed]
Hopefully this gives you a path forward to try to debug this issue.
Regards,
Lance Chaney