Editor.AsyncStaticMeshCompilationMaxConcurrency
Editor.AsyncStaticMeshCompilationMaxConcurrency
#Overview
name: Editor.AsyncStaticMeshCompilationMaxConcurrency
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Set the maximum number of concurrent static meshes compilation, -1 for unlimited.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Editor.AsyncStaticMeshCompilationMaxConcurrency is to control the maximum number of concurrent async static mesh compilations in Unreal Engine 5’s editor. This setting is part of the performance optimization system for static mesh compilation.
-
This setting is primarily used by the Engine’s static mesh compilation subsystem, specifically within the StaticMeshCompiler module.
-
The value of this variable is set through the AsyncCompilationHelpers::EnsureInitializedCVars function, which is called in the StaticMeshCompilingManagerImpl namespace.
-
This variable interacts closely with CVarAsyncStaticMeshStandard.AsyncCompilation and CVarAsyncStaticMeshStandard.AsyncCompilationMaxConcurrency.
-
Developers should be aware that this setting affects the performance and resource utilization during static mesh compilation. Setting it too high might overload the system, while setting it too low might unnecessarily slow down compilation.
-
Best practices include adjusting this value based on the available system resources and the project’s specific needs. It’s important to find a balance between compilation speed and system stability.
Regarding the associated variable bEnableAsyncStaticMeshCompilation:
The purpose of bEnableAsyncStaticMeshCompilation is to enable or disable asynchronous static mesh compilation in the Unreal Engine editor.
-
This setting is part of the UEditorExperimentalSettings class, which suggests it’s an experimental feature that can be toggled in the editor settings.
-
The value of this variable is set in the UEditorExperimentalSettings constructor, defaulting to false.
-
It interacts with the AsyncCompilationHelpers system and is used to determine whether async compilation should be used for static meshes.
-
Developers should be aware that enabling this feature can improve import and map load time performance when compilation is required, but it may also introduce new behaviors or potential issues as it’s an experimental feature.
-
Best practices include testing thoroughly when enabling this feature, especially in larger projects, to ensure it doesn’t introduce unexpected side effects. It’s also advisable to keep an eye on future updates that might stabilize or improve this feature.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/StaticMeshCompiler.cpp:69
Scope (from outer to inner):
file
namespace StaticMeshCompilingManagerImpl
function static void EnsureInitializedCVars
Source code excerpt:
AsyncCompilationHelpers::EnsureInitializedCVars(
TEXT("staticmesh"),
CVarAsyncStaticMeshStandard.AsyncCompilation,
CVarAsyncStaticMeshStandard.AsyncCompilationMaxConcurrency,
GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, bEnableAsyncStaticMeshCompilation));
}
}
}
#Associated Variable and Callsites
This variable is associated with another variable named bEnableAsyncStaticMeshCompilation
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/EditorExperimentalSettings.h:14
Scope (from outer to inner):
file
class class UEditorExperimentalSettings : public UObject
Source code excerpt:
*/
UCLASS(config=EditorPerProjectUserSettings, MinimalAPI)
class UEditorExperimentalSettings
: public UObject
{
GENERATED_UCLASS_BODY()
public:
/** Enable async texture compilation to improve PIE and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async texture compilation and loading"))
bool bEnableAsyncTextureCompilation;
/** Enable async static mesh compilation to improve import and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async static mesh compilation and loading"))
bool bEnableAsyncStaticMeshCompilation;
/** Enable async skeletal mesh compilation to improve import and map load time performance when compilation is required */
UE_DEPRECATED(5.1, "Deprecated & replaced by bEnableAsyncSkinnedAssetCompilation.")
UPROPERTY(/*EditAnywhere - deprecated & replaced by bEnableAsyncSkinnedAssetCompilation, */config/*, Category = Performance, meta = (DisplayName = "Enable async skeletal mesh compilation and loading")*/)
bool bEnableAsyncSkeletalMeshCompilation;
/** Enable async skinned asset compilation to improve import and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async skinned asset compilation and loading"))
bool bEnableAsyncSkinnedAssetCompilation;
/** Enable async sound compilation to improve import and map load time performance when compilation is required */
UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async sound compilation and loading"))
bool bEnableAsyncSoundWaveCompilation;
/** Allows the editor to run on HDR monitors on Windows 10 */
UPROPERTY(EditAnywhere, config, Category = HDR, meta = (ConfigRestartRequired = true, DisplayName = "Enable Editor Support for HDR Monitors"))
bool bHDREditor;
/** The brightness of the slate UI on HDR monitors */
UPROPERTY(EditAnywhere, config, Category = HDR, meta = (ClampMin = "100.0", ClampMax = "300.0", UIMin = "100.0", UIMax = "300.0"))
float HDREditorNITLevel;
/** Allows usage of the procedural foliage system */
UPROPERTY(EditAnywhere, config, Category = Foliage, meta = (DisplayName = "Procedural Foliage"))
bool bProceduralFoliage;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:172
Scope (from outer to inner):
file
function UEditorExperimentalSettings::UEditorExperimentalSettings
Source code excerpt:
TEXT("Editor.HDRSupport"),
0,
TEXT("Sets whether or not we should allow the editor to run on HDR monitors"),
ECVF_Default);
static TAutoConsoleVariable<float> CVarEditorHDRNITLevel(
TEXT("Editor.HDRNITLevel"),
160.0f,
TEXT("Sets The desired NIT level of the editor when running on HDR"),
ECVF_Default);
UEditorExperimentalSettings::UEditorExperimentalSettings( const FObjectInitializer& ObjectInitializer )
: Super(ObjectInitializer)
, bEnableAsyncTextureCompilation(false)
, bEnableAsyncStaticMeshCompilation(false)
, bEnableAsyncSkeletalMeshCompilation(true) // This was false and set to True in /Engine/Config/BaseEditorPerProjectUserSettings.ini. The setting is removed from .ini so change it to default True.
, bEnableAsyncSkinnedAssetCompilation(false)
, bEnableAsyncSoundWaveCompilation(false)
, bHDREditor(false)
, HDREditorNITLevel(160.0f)
, bUseOpenCLForConvexHullDecomp(false)
, bAllowPotentiallyUnsafePropertyEditing(false)
, bPackedLevelActor(true)
, bLevelInstance(true)
{
}
void UEditorExperimentalSettings::PostInitProperties()
{
PRAGMA_DISABLE_DEPRECATION_WARNINGS
// bEnableAsyncSkeletalMeshCompilation's default to True (see comment in constructor above).
// To be backwards compatible, if a user project overrides it to False, pass on the value to bEnableAsyncSkinnedAssetCompilation.
if (!bEnableAsyncSkeletalMeshCompilation)
{
UE_LOG(LogSettingsClasses, Warning, TEXT("bEnableAsyncSkeletalMeshCompilation is deprecated and replaced with bEnableAsyncSkinnedAssetCompilation. Please update the config. Setting bEnableAsyncSkinnedAssetCompilation to False."));
bEnableAsyncSkinnedAssetCompilation = false;
}
PRAGMA_ENABLE_DEPRECATION_WARNINGS
CVarEditorHDRSupport->Set(bHDREditor ? 1 : 0, ECVF_SetByProjectSetting);
CVarEditorHDRNITLevel->Set(HDREditorNITLevel, ECVF_SetByProjectSetting);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/StaticMeshCompiler.cpp:60
Scope (from outer to inner):
file
namespace StaticMeshCompilingManagerImpl
function static void EnsureInitializedCVars
Source code excerpt:
namespace StaticMeshCompilingManagerImpl
{
static void EnsureInitializedCVars()
{
static bool bIsInitialized = false;
if (!bIsInitialized)
{
bIsInitialized = true;
AsyncCompilationHelpers::EnsureInitializedCVars(
TEXT("staticmesh"),
CVarAsyncStaticMeshStandard.AsyncCompilation,
CVarAsyncStaticMeshStandard.AsyncCompilationMaxConcurrency,
GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, bEnableAsyncStaticMeshCompilation));
}
}
}
FStaticMeshCompilingManager::FStaticMeshCompilingManager()
: Notification(MakeUnique<FAsyncCompilationNotification>(GetAssetNameFormat()))
{
StaticMeshCompilingManagerImpl::EnsureInitializedCVars();
PostReachabilityAnalysisHandle = FCoreUObjectDelegates::PostReachabilityAnalysis.AddRaw(this, &FStaticMeshCompilingManager::OnPostReachabilityAnalysis);
}
void FStaticMeshCompilingManager::OnPostReachabilityAnalysis()
{
if (GetNumRemainingMeshes())
{
TRACE_CPUPROFILER_EVENT_SCOPE(FStaticMeshCompilingManager::CancelUnreachableMeshes);
TArray<UStaticMesh*> PendingStaticMeshes;
PendingStaticMeshes.Reserve(GetNumRemainingMeshes());
for (auto Iterator = RegisteredStaticMesh.CreateIterator(); Iterator; ++Iterator)
{
UStaticMesh* StaticMesh = Iterator->GetEvenIfUnreachable();
if (StaticMesh && StaticMesh->IsUnreachable())
{