Significant performance regression in ResavePackagesCommandlet when running -FixupRedirects

We run a nightly job that fixes up redirects and rebuilds texture streaming for all packages, with the following command-line:

UnrealEditor-Cmd.exe Path/To/My/Project.uproject -SCCProvider=Perforce -P4User=my_user -P4Client=my_client -Log -Unattended -NoPause -NoSound -BuildMachine -Run=ResavePackages -AutoCheckout -AutoCheckin -ProjectOnly -SkipCheckedOutPackages -IgnoreChangelist -OnlySaveDirtyPackages -FixupRedirects -BuildTextureStreamingForAllWe recently upgraded from UE 5.4 to 5.5, and when we did, we noticed that this above command-line, which used to take about 6.5 minutes, started timing out at 4 hours. From the logs, it’s clear that GC is absolutely dominating the runtime here, because almost every single package now requires waiting for static meshes to be ready:

[2025.04.23-12.27.03:960][ 0]LogContentCommandlet: Display: Loading MyProject/Content/__ExternalActors__/Maps/MyMap/KWKNPF35FR8YWZJDHSBNKW.uasset [2025.04.23-12.27.04:737][ 0]LogStaticMesh: Display: Waiting for static meshes to be ready 1/15 (/Game/Path/To/StaticMesh) ... [2025.04.23-12.27.04:770][ 0]LogStaticMesh: Display: Waiting for static meshes to be ready 3/15 (/Game/Path/To/StaticMesh) ... [2025.04.23-12.27.04:787][ 0]LogStaticMesh: Display: Waiting for static meshes to be ready 4/15 (/Game/Path/To/StaticMesh) ... [2025.04.23-12.27.35:934][ 0]LogUObjectHash: Compacting FUObjectHashTables data took 1.25msMy theory on why this changed is this: https://github.com/EpicGames/UnrealEngine/blame/release/Engine/Source/Editor/UnrealEd/Private/Commandlets/ContentCommandlets.cpp\#L1959

I believe that in UE 5.4, these packages were resaved within the scope of ScopedGCFreq, but now because of this if (!bFixupRedirects) condition, they are resaved outside of this, and thus GC is done after every single package resave.

We can alleviate this issue by passing in the -GCFreq=N flag to batch GC up, but I wanted to raise this as it’s a massive performance regression in 5.5 if you’re not specifying a GC frequency as a command-line argument. It would be nice to fix the performance of this and go back to it Just Working!

Steps to Reproduce
Run on a project with a non-trivial amount of content (Lyra should suffice, I didn’t test it though):

UnrealEditor-Cmd.exe Path/To/My/Project.uproject -Log -Unattended -NoPause -NoSound -BuildMachine -Run=ResavePackages -ProjectOnly -SkipCheckedOutPackages -IgnoreChangelist -OnlySaveDirtyPackages -FixupRedirects -BuildTextureStreamingForAllObserve that this operation takes an extremely long time.

Add the flag -GCFreq=10000 (or some other reasonably large number) and run again. Observe that this operation is much, much faster.

Hello,

I apologize for the delay. Thanks for bringing this up, and I’ll take a look into it.

Thanks,

Ryan

Sorry for the radio silence. I kept this open to respond once I had time to make the changes, but I haven’t had the chance to do so due to some other priorities. Since you have a valid workaround, I’ll let this case be closed. The issue has been logged in JIRA so that it doesn’t get lost. Again, thanks for reporting this.

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.

-Ryan