SourceControlAssetDataCache.MaxAsyncTask

SourceControlAssetDataCache.MaxAsyncTask

#Overview

name: SourceControlAssetDataCache.MaxAsyncTask

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of SourceControlAssetDataCache.MaxAsyncTask is to control the maximum number of tasks running in parallel to fetch AssetData information in the source control system.

This setting variable is primarily used by the Source Control module in Unreal Engine. It’s specifically utilized within the FSourceControlAssetDataCache class, which is part of the source control subsystem.

The value of this variable is set as a console variable using TAutoConsoleVariable. It’s initialized with a default value of 8, but can be changed at runtime through console commands or configuration files.

The associated variable CVarSourceControlAssetDataCacheMaxAsyncTask directly interacts with SourceControlAssetDataCache.MaxAsyncTask. They share the same value and purpose.

Developers must be aware that this variable affects the parallelism of asset data fetching operations. Setting it too high might overwhelm the system resources, while setting it too low might slow down source control operations.

Best practices when using this variable include:

  1. Adjusting it based on the available system resources and the size of the project.
  2. Monitoring performance impact when changing this value.
  3. Considering the network and source control server capacity when increasing this value.

Regarding the associated variable CVarSourceControlAssetDataCacheMaxAsyncTask:

The purpose of CVarSourceControlAssetDataCacheMaxAsyncTask is identical to SourceControlAssetDataCache.MaxAsyncTask. It’s the actual console variable that controls the maximum number of parallel tasks for fetching AssetData information.

This variable is used in the Source Control module, specifically in the FSourceControlAssetDataCache class.

The value is set when the console variable is created, but can be modified at runtime using console commands.

It directly interacts with the SourceControlAssetDataCache.MaxAsyncTask setting, as they represent the same configuration.

Developers should be aware that this is the actual variable used in the code to control the behavior, while SourceControlAssetDataCache.MaxAsyncTask is the name used for console commands.

Best practices include:

  1. Using this variable name when programmatically accessing or modifying the value in C++ code.
  2. Ensuring that any changes to this variable are reflected in the overall source control system performance.
  3. Documenting any project-specific optimal values found during development or operation.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Developer/SourceControl/Private/SourceControlAssetDataCache.cpp:17

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarSourceControlAssetDataCacheMaxAsyncTask(
	TEXT("SourceControlAssetDataCache.MaxAsyncTask"),
	8,
	TEXT("Maximum number of task running in parallel to fetch AssetData information.")
);

void FSourceControlAssetDataCache::Startup()
{

#Associated Variable and Callsites

This variable is associated with another variable named CVarSourceControlAssetDataCacheMaxAsyncTask. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Developer/SourceControl/Private/SourceControlAssetDataCache.cpp:16

Scope: file

Source code excerpt:

#endif

static TAutoConsoleVariable<int32> CVarSourceControlAssetDataCacheMaxAsyncTask(
	TEXT("SourceControlAssetDataCache.MaxAsyncTask"),
	8,
	TEXT("Maximum number of task running in parallel to fetch AssetData information.")
);

void FSourceControlAssetDataCache::Startup()

#Loc: <Workspace>/Engine/Source/Developer/SourceControl/Private/SourceControlAssetDataCache.cpp:215

Scope (from outer to inner):

file
function     void FSourceControlAssetDataCache::LaunchFetchAssetDataTasks

Source code excerpt:

{
	FSourceControlStatePtr FileState;
	const uint32 MaxAsyncTask = static_cast<uint32>(CVarSourceControlAssetDataCacheMaxAsyncTask.GetValueOnGameThread());

	check(MaxAsyncTask > 0);

	while ((CurrentAsyncTask < MaxAsyncTask) && AssetDataToFetch.Dequeue(FileState))
	{
		check(FileState.IsValid());