Resource Usage - anticto/Mutable-Documentation GitHub Wiki

This section is only relevant for projects using Mutable at runtime. If your project is using a workflow that uses mutable only in the Editor then the resource usage will just be the standard one of the Unreal Engine resources created while editing.

When used at runtime, Mutable requires some resources to be able to generate new assets. These are:

  • CPU Time:
    • Almost all computation is done in Worker Threads, using the Task Graph system. There are also two synchronization points with the Game Thread, at the beginning and at the end of an update, due to the interaction with UObjects.
  • Memory: In addition to the generated resources, Mutable also requires some temporary memory to operate.
  • Disk Streaming Bandwidth: Mutable will be loading, on demand, the data required to generate the customization.

There are Unreal Insights channels for Mutable both for CPU and memory usage. Enabling them in captures will give a very good idea of the work done at runtime.

CPU Time

All Mutable customizations are asynchronous. As of 5.8, Mutable parallelizes the following three types of tasks: Initial Customizations, Skeletal Mesh Streaming and Texture Streaming. This is something to take into consideration since when requesting multiple customizations at the same time, the time span from the first to the last customization is not negligible.

Memory

The amount of working memory used by Mutable depends directly on the customization being generated. A ballpark estimation of the upper limit is around 2 times the memory for the biggest generated Texture (uncompressed format), or Skeletal Mesh.

At any time, Mutable will try to keep its memory usage under the Working Memory limit. This limit can be adjusted using the mutable.WorkingMemory CVAR or with the UCustomizableObjectSystem API. Although Mutable will try to always respect this limit, it is a soft one. If an operation requires more memory to be executed, it will exceed it.

Mutable will also automatically use all unused Working Memory as cache memory. This allows it to greatly speed up its generations, especially when using States.

Performance Analyzer

Since the CPU Time and memory consumptions depend greatly on the current customization, it is very hard to have the full picture. The Performance Analyzer tool aims to solve this issue by generating many random customizations while monitoring their resource usages. This tool is located in the Customizable Object Editor.