Tweaks

Entities

Scenes and overlays contain entity lists. When a scene or overlay is created, block size and increment can be specified. These parameters control allocation for entities in the entity list. Entity lists allocate memory in blocks, and the block size controls the size of block to allocate. Increment controls how many blocks to allocate at a time. Increment doubles each time the list expands. Blocks are an important part of managing CPU cache coherency.

The best block size depends on the average size of entities in the list. The goal is to have most entities fit in 1 block while larger entities use 2 or more blocks. If all entities fit in 1 block, the block size could be too big and memory is being unused. When the scene or overlay is released, a report is output that shows how blocks where allocated to the entities. It shows the count of entities that took 1 block, 2 blocks, 3 blocks etc. This can be used to adjust the block size to reach the goal mentioned earlier.

Workspaces

Workspaces are used for handling GPU allocation. These have to use a fixed sized for optimal performance. If a workspace is unable to allocate an object because the fixed size is released, an error will be reported with details of the allocation. Use the set workspace function in the engine configuration for the type of workspace reported in the error message to set a higher limit for the type of objects that have reached the limit.

When the engine is released, a report is output that has the current number of objects allocated and the current limits for each of the workspaces. This can help to manage capacities proactively instead of waiting for an error to occur.