Long cook times

Is there any work being done on multi-thread or multi-process cooking? That would be a huge win for us.

We currently have almost 28,000 assets that take close to an hour to cook. Is this within the ballpark of what you’d expect? We also noticed large increases in cook times from both 4.16 and 4.17 on all platforms (PC, PS4, Xbox).

We’ve added a lot of instrumentation to our cook to help track this down, but have not seen any smoking guns. Here’s an example of our cook. Do you have any recommendations on what we can look for?

Misc Cook Stats

Cook Profile
0. 0.StartupWallTimeSec=344.205438
0. 1.CookByTheBookTimeSec=2919.506500
0. 1. 0.StartCookByTheBookTimeSec=20.913601
0. 1. 0. 0.GameCookModificationDelegateTimeSec=0.185849
0. 1. 1.TickCookOnTheSideTimeSec=2840.968260
0. 1. 1. 0.TickCookOnTheSideLoadPackagesTimeSec=564.124317
0. 1. 1. 1.TickCookOnTheSideSaveCookedPackageTimeSec=2070.635674
0. 1. 1. 1. 0.TickCookOnTheSideResolveRedirectorsTimeSec=0.000000
0. 1. 1. 1. 1.TickCookOnTheSideVerifyCanCookPackageSec=255.172285
0. 1. 1. 1. 2.TickCookOnTheSideConvertBlueprintsSec=0.752136
0. 1. 1. 2.TickCookOnTheSideBeginPackageCacheForCookedPlatformDataTimeSec=65.476262
0. 1. 1. 3.TickCookOnTheSideFinishPackageCacheForCookedPlatformDataTimeSec=0.811819
0. 1. 1. 4.TickCookOnTheSideWaitForAsyncWorkAndCleanUpSec=0.000044
0. 1. 1. 4. 0.TickCookOnTheSideAsyncWriteFilesSec=0.037170
0. 1. 1. 4. 1.TickCookOnTheSideSyncDDCFilesSec=0.009366
0. 1. 1. 4. 2.TickCookOnTheSideSaveShaderCacheSec=0.000000
0. 1. 1. 4. 3.TickCookOnTheSideGenerateManifestSec=0.000000
0. 1. 1. 4. 3. 0.TickCookOnTheSideSaveCookedAssetRegistrySec=0.000000
0. 1. 1. 4. 4.TickCookOnTheSideMapDependencySec=0.000000
0. 1. 2.TickLoopGCTimeSec=0.000000
0. 1. 3.TickLoopRecompileShaderRequestsTimeSec=0.000978
0. 1. 4.TickLoopShaderProcessAsyncResultsTimeSec=0.000800
0. 1. 5.TickLoopProcessDeferredCommandsTimeSec=0.002197
0. 1. 6.TickLoopTickCommandletStatsTimeSec=0.000184

We also have lots of ActiveClassRedirects and other redirector. Do these affect cook times?

Thanks, Joe. We regularly fixup content redirectors because we knew those would be a problem.

Try this out: https://udn.unrealengine.com/questions/403509/asset-loading-poor-performance-on-windows.html

There were some regressions in cook time performance over the past few versions, but we’ve recently been looking at them and have made a few fixes that have helped. These changes should all be in our main branch now and should be available in 4.19. If you need some more specifics about cherry picking things that might help, let me know.

Otherwise, I’d be double checking the usual suspects. Are you happy that the assets that are being cooked are all required for your runtime game? (i.e. are you cooking test data or editor only reference data that isn’t necessary for the game?) Do you have a shared DDC server set up to cache intermediates? Have you tried iterative cooking to speed up incremental builds?

If you want to attach a full cook log, there might be a bit more information in there.

I had a quick look over those logs and compared it with some equivalent Fortnite logs. Everything kind of looked similar, so I don’t think you’re a million miles away from what we would expect. I noticed that there are a few minutes taken up by that verifycancookpackage stuff that I mentioned above, so you could save a few minutes by removing that?

Someone else will have to weigh in for the class redirects. For content redirects, they will increase cook time for each content, slightly, since it requires a load, get a new path to the content, and a final load

Thanks, Riley. That’s a useful change, but it doesn’t look like that code path is taken during cooking.

Here the timings we have:

UE4Editor-Cmd: Execution of commandlet took:  339.50 seconds


Cook: Execution of commandlet took:  3846.86 seconds

Around 80% of time goes to GEditorSavePackage. Is that something we can expect to be addressed in 4.19?
link text

Looking at your log, that particular run of the cooker did a lot of DDC generation. What kind of timings do you get when you re-run that cook a second time using the primed DDC?

The changes we have made so far that will appear in 4.19 have helped a lot with our own internal project cook times, although they are still slower than several versions ago. It’s difficult to say whether they will “fix” your problems, but they should hopefully improve things.



Archiving just creates a complete copy of the build output in a specified directory, and shouldn’t affect cook times noticeably.

It might be worth having a look at this post, as they were reporting similar issues to you and managed to get some good improvements!


The basic gist was that the VerifyCanCookPackage function on the asset manager class can be slow, and if you’re not using the “never cook” or “development only cook” functionality then there could be a win by deriving your own asset manager class and overriding that function to disable the checks within. The licensee in that linked thread reported a big win from doing that!

link text

This is a fairly fast iteration of our cooker, cooking only maps that we are actively testing. We get 97.5% hit on the local DDC, but still spend a lot of time saving the 13GB of packages.

I had a quick look over those logs and compared it with some equivalent Fortnite logs. Everything kind of looked similar, so I don’t think you’re a million miles away from what we would expect. I noticed that there are a few minutes taken up by that verifycancookpackage stuff that I mentioned above, so you could save a few minutes by removing that?

Thanke, Graeme. We have disabled VerifyCanCookPackage, and it did help. We’re also doing our best to limit the number of maps we’re cooking. One thing we found that made a huge difference was adding memory to our build machines. 64GB just wasn’t enough, and 128GB works much better!

Awesome. Yeah, more memory is a great idea as it will reduce the need to collect garbage, which can flush out loaded assets that will need to be loaded again later on!

And faster NVMe drives also help quite a bit.

Yep we have that change but our cook times are still high.

The timings when the cook ran the second time is pretty much the same. I would guess the cooker is using the cache. Though I assume it does it by default, we don’t do anything specific for that rather than using the same machine for the same configuration.
That’s the arguments we use to cook development build:

-noP4 -platform=Win64 -config=Development -game -build -cook -allmaps -stage

The arguments are copied from :

A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

With the exception to archive part. The argument didn’t have any effect on time in 4.12.5. Let me know if it’s recommended to use the archive for cooking.

I seem to have no access to the post. Could you please share the details that might be useful?