Is ResavePackages expected to take significantly longer than a cook?

Is it expected that running the ResavePackages commandlet on an entire project takes significantly longer than cooking a build? From what I understand, resaving simply loads and then saves packages. When I go through the log, 88% of the over 5 million lines is “Skipping non mounted imported package”. I’m not sure if that is indicative of anything.

This is the effective command: UnrealEditor-Cmd.exe “<redacted>.uproject” -run=ResavePackages -ProjectOnly -fileopenlog -AutoCheckOutPackages -SkipCheckedOutPackages -OnlySaveDirtyPackages -SkipCheckedOutPackages -SkipDeveloperFolders -SCCProvider=Perforce -P4Port=<redacted> -P4User=<redacted> -P4Client=<redacted> -P4Changelist=<redacted> -P4Passwd=<redacted> -abslog=“<redacted>\ResavePackages-2025.04.09-10.14.01.txt” -stdout -CrashForUAT -unattended -NoLogTimes

This is the command I’m using to cook: RunUAT.bat BuildCookRun -project=<redacted>.uproject -configuration=Development -platform=Win64 -build -cook

Admittedly, the project I’m running this on is rather large, but I wasn’t expecting to wait 9 hours for ResavePackages to complete when it only takes a cook 3 hours. Is this normal?

Hi Daniel,

The short answer is that it is probably normal.

The long answer…

The ResavePackages as you shared will load\save all the assets that are in the project’s content folder. This require fully loading the packages (uasset files) including the bulkdata (usually the source of the assets that was imported). The amount of data being read\saved is much higher for a single asset. A texture asset will contain the BMP\PNG\PSD. The cooked version of the asset will contain the platform specific version of the data (DXT compressed buffer for textures). If you are using World Partition and one file per actor, all the actor files need to be read\saved. When cooking the WP level, the data gets redistributed in multiple maps based on the cell generation. There is way less files to write.

Also, the cook command behavior depends if there are levels in the MapsToCook table in the ProjectPackagingSettings. This is stored in DefaultGame.ini. If you have levels specified, the cook commandlet will only care for those levels, their dependency chain and the folders in the DirectoriesToAlwaysCook table. If no levels are specified, the entire project will get cooked. This can make a huge difference as all the non-referenced data will not be touched while cooking.

There are also some factors such as the frequency of garbage collection.

In general, you will run the ResavePackages rarely. You should do it when upgrading to a newer release of the engine, when you want to get rid of CoreRedirectors (the ones in ini) or when a custom UObject schema get a significant change that requires a costly conversion in Serialize or PostLoad. You can also resave assets from the Content Browser in the editor which allow for easy selective resaves of specific types\folders.

Another reason to run Resave Packages is to clean the redirectors (the uasset ones) but this operation relies on the AssetRegistry and will only touch the affected assets so it should not be too long.

Regards,

Martin