bDisableThreadedIndexing

bDisableThreadedIndexing

#Overview

name: bDisableThreadedIndexing

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bDisableThreadedIndexing is to control the threading behavior of the Blueprint indexing process in Unreal Engine’s Find-in-Blueprint feature. This setting variable is primarily used in the Kismet module, which is part of the Unreal Engine’s editor subsystem.

The Kismet module, specifically the FFindInBlueprintSearchManager class, relies on this setting variable to determine how Blueprint indexing should be performed. It affects the search and caching operations for Blueprints within the editor.

The value of this variable is set from the GEditorIni configuration file, under the “BlueprintSearchSettings” section. It is read during the initialization of the FFindInBlueprintSearchManager.

This variable interacts closely with other related variables such as bDisableDeferredIndexing and AsyncTaskBatchSize, which together control the indexing behavior of Blueprints.

Developers must be aware that when bDisableThreadedIndexing is set to true:

  1. Blueprint indexing will occur on the main thread, which may impact editor performance.
  2. It affects how unloaded assets are handled during searches.
  3. It changes the behavior of caching operations for Blueprints.

Best practices when using this variable include:

  1. Generally, keep it disabled (false) to allow for better performance through multithreaded indexing.
  2. Enable it only when debugging indexing issues or when specific single-threaded behavior is required.
  3. Consider the impact on editor performance when enabling this option, especially for projects with many Blueprints.
  4. Use in conjunction with other related settings (like bDisableDeferredIndexing) to fine-tune the indexing behavior as needed.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditor.ini:539, section: [BlueprintSearchSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp:2081

Scope (from outer to inner):

file
function     void FFindInBlueprintSearchManager::Initialize

Source code excerpt:

	GConfig->GetInt(TEXT("BlueprintSearchSettings"), TEXT("AsyncTaskBatchSize"), AsyncTaskBatchSize, GEditorIni);
	GConfig->GetBool(TEXT("BlueprintSearchSettings"), TEXT("bDisableDeferredIndexing"), bDisableDeferredIndexing, GEditorIni);
	GConfig->GetBool(TEXT("BlueprintSearchSettings"), TEXT("bDisableThreadedIndexing"), bDisableThreadedIndexing, GEditorIni);
	GConfig->GetBool(TEXT("BlueprintSearchSettings"), TEXT("bEnableCsvStatsProfiling"), bEnableCSVStatsProfiling, GEditorIni);
	GConfig->GetBool(TEXT("BlueprintSearchSettings"), TEXT("bEnableDeveloperMenuTools"), bEnableDeveloperMenuTools, GEditorIni);
	GConfig->GetBool(TEXT("BlueprintSearchSettings"), TEXT("bDisableSearchResultTemplates"), bDisableSearchResultTemplates, GEditorIni);
	GConfig->GetBool(TEXT("BlueprintSearchSettings"), TEXT("bDisableImmediateAssetDiscovery"), bDisableImmediateAssetDiscovery, GEditorIni);

#if CSV_PROFILER

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp:2351

Scope (from outer to inner):

file
function     void FFindInBlueprintSearchManager::ExtractUnloadedFiBData

Source code excerpt:


	// In these modes, or if there is no tag data, no additional indexing work is deferred for unloaded assets.
	if (!bDisableDeferredIndexing && !bDisableThreadedIndexing && NewSearchData.HasEncodedValue())
	{
		// Add it to the list of assets that require a full index rebuild from the metadata. This work will not block the main thread and is decoupled from the search thread.
		PendingAssets.Add(NewSearchData.AssetPath);
	}
	else
	{

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp:2667

Scope (from outer to inner):

file
function     void FFindInBlueprintSearchManager::AddOrUpdateBlueprintSearchMetadata

Source code excerpt:

			// a) Deferred or multithreaded indexing is disabled. In these cases, indexing will be handled by the search thread.
			// b) There is no generated metadata. In this case, there's nothing to search, so there's no need to index the asset.
			if (bDisableDeferredIndexing || bDisableThreadedIndexing || SearchData.Value.Len() == 0)
			{
				// Mark it as having been indexed (it's now searchable).
				SearchData.StateFlags |= ESearchDataStateFlags::IsIndexed;

				// Remove it from the list of pending assets (if it exists).
				PendingAssets.Remove(AssetPath);
			}
			else if(!bDisableThreadedIndexing)
			{
				// With multithreaded indexing, we defer additional work beyond regenerating the metadata, so ensure it's been added.
				PendingAssets.Add(AssetPath);
			}
		}
		else if (!bDisableDeferredIndexing)

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp:2872

Scope (from outer to inner):

file
function     bool FFindInBlueprintSearchManager::ContinueSearchQuery

Source code excerpt:

	{
		// In these modes, the full index may not have been parsed yet. We'll do that now on the search thread.
		if (bDisableDeferredIndexing || bDisableThreadedIndexing)
		{
			// Must lock this behind a critical section to ensure that no other thread is accessing it at the same time
			FScopeLock Lock(&SafeModifyCacheCriticalSection);

			// Grab the latest entry from the cache. In the case of parallel global searches, one of the other threads may have already updated it while we were blocked by the mutex above.
			SearchData = GetSearchDataForAssetPath(SearchData.AssetPath);

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp:3238

Scope (from outer to inner):

file
function     void FFindInBlueprintSearchManager::CacheAllAssets

Source code excerpt:

			}

			if (bDisableThreadedIndexing)
			{
				CacheParams.OpFlags |= EFiBCacheOpFlags::ExecuteOnMainThread;
			}
//			else if (bEnableCSVStatsProfiling)
//			{
//				CacheParams.OpFlags |= EFiBCacheOpFlags::ExecuteOnSingleThread;

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Private/FindInBlueprintManager.cpp:3251

Scope (from outer to inner):

file
function     void FFindInBlueprintSearchManager::CacheAllAssets

Source code excerpt:


			// If async indexing is disabled, or if it's enabled and we're allowed to do a full index pass, use the full array
			if (bDisableThreadedIndexing || bHasFirstSearchOccurred)
			{
				// Create a new instance of the caching object.
				CachingObject = MakeUnique<FCacheAllBlueprintsTickableObject>(PendingAssets, CacheParams);
			}
			else
			{

#Loc: <Workspace>/Engine/Source/Editor/Kismet/Public/FindInBlueprintManager.h:887

Scope (from outer to inner):

file
class        class FFindInBlueprintSearchManager : public FTickableEditorObject

Source code excerpt:

	/** If true, and if deferred indexing is not disabled, search metadata will be regenerated for loaded assets on the main thread at a rate of one asset per tick. Additional indexing
		work will be deferred to the search thread. By default, all indexing work is deferred to a background thread and both loaded and unloaded assets are fully indexed asynchronously. */
	bool bDisableThreadedIndexing;

	/** Whether CSV profiling has been enabled (default=false) */
	bool bEnableCSVStatsProfiling;

	/** Whether to enable Blueprint editor developer menu tools */
	bool bEnableDeveloperMenuTools;