Concert.SetCompressionSizeLimit
Concert.SetCompressionSizeLimit
#Overview
name: Concert.SetCompressionSizeLimit
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The compressor incurs a performance cost and will only be used if the package size is less than the amount specified (default 32 MB). A value of 0 or less will always compress.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Concert.SetCompressionSizeLimit is to control the compression behavior for data serialization in the Concert plugin of Unreal Engine 5. Specifically, it sets a size threshold for when compression should be applied to data packages.
This setting variable is primarily used by the Concert plugin, which is part of the Developer tools in Unreal Engine 5. It’s particularly relevant to the data serialization and network communication aspects of the Concert system.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 32 (MB) but can be changed at runtime through console commands or configuration files.
The associated variable CVarCompressionSizeLimit directly interacts with Concert.SetCompressionSizeLimit. They share the same value and purpose.
Developers should be aware that:
- This variable affects performance. Compression is only applied if the package size is less than the specified limit to avoid unnecessary performance costs for small packages.
- A value of 0 or less will always trigger compression, regardless of package size.
- This setting works in conjunction with other compression-related variables like CVarCompressionFlags and likely a compression type variable (though not shown in the provided code).
Best practices when using this variable include:
- Carefully consider the trade-off between network bandwidth and CPU usage when setting this value.
- Monitor performance metrics to find the optimal value for your specific use case.
- Be aware of how this interacts with other compression settings in the Concert system.
Regarding the associated variable CVarCompressionSizeLimit:
- Its purpose is identical to Concert.SetCompressionSizeLimit, serving as the actual storage and access point for the compression size limit value.
- It’s used internally by the Concert plugin to retrieve the current compression size limit.
- The value is accessed through the GetConsoleVariableCompressionSizeLimit() function, which can be called from various parts of the Concert plugin code.
- Developers should treat CVarCompressionSizeLimit and Concert.SetCompressionSizeLimit as two interfaces to the same setting, with the CVar being the internal representation and the Concert.SetCompressionSizeLimit being the external interface for configuration.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertMain/Source/Concert/Private/ConcertMessageData.cpp:177
Scope (from outer to inner):
file
namespace UE::Concert::Compression
Source code excerpt:
static TAutoConsoleVariable<int32> CVarCompressionSizeLimit(
TEXT("Concert.SetCompressionSizeLimit"), 32,
TEXT("The compressor incurs a performance cost and will only be used if the package size is less than the amount specified (default 32 MB). A value of 0 or less will always compress."));
static TAutoConsoleVariable<int32> CVarCompressionFlags(
TEXT("Concert.SetCompressionFlags"), 0,
TEXT("Specify the flags to use when compression is enabled. A value of 0 means no flags. A value of 1 favors smaller sizes. Any other value favors faster encoding."));
#Associated Variable and Callsites
This variable is associated with another variable named CVarCompressionSizeLimit
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertMain/Source/Concert/Private/ConcertMessageData.cpp:176
Scope (from outer to inner):
file
namespace UE::Concert::Compression
Source code excerpt:
TEXT("Specify the type of compression to use when serializing data. A value of 0 means compression is off. A value of 1 = Oodle. All other values = Zlib."));
static TAutoConsoleVariable<int32> CVarCompressionSizeLimit(
TEXT("Concert.SetCompressionSizeLimit"), 32,
TEXT("The compressor incurs a performance cost and will only be used if the package size is less than the amount specified (default 32 MB). A value of 0 or less will always compress."));
static TAutoConsoleVariable<int32> CVarCompressionFlags(
TEXT("Concert.SetCompressionFlags"), 0,
TEXT("Specify the flags to use when compression is enabled. A value of 0 means no flags. A value of 1 favors smaller sizes. Any other value favors faster encoding."));
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertMain/Source/Concert/Private/ConcertMessageData.cpp:196
Scope (from outer to inner):
file
namespace UE::Concert::Compression
function int32 GetConsoleVariableCompressionSizeLimit
Source code excerpt:
int32 GetConsoleVariableCompressionSizeLimit()
{
return CVarCompressionSizeLimit.GetValueOnAnyThread();
}
}
namespace PayloadDetail
{