From aef024f5729768efe99a45b5a7f85d823de965eb Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 8 Oct 2021 16:19:48 +0200 Subject: [PATCH] Change Content loading threads count to depend on logical cores count instead of physical (set limit to 12) --- Source/Engine/Content/Config.h | 2 +- Source/Engine/Content/Loading/ContentLoadingManager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Content/Config.h b/Source/Engine/Content/Config.h index 6f23dd40f..3368b8b63 100644 --- a/Source/Engine/Content/Config.h +++ b/Source/Engine/Content/Config.h @@ -5,7 +5,7 @@ #include "Engine/Core/Config.h" // Amount of content loading threads per single physical CPU core -#define LOADING_THREAD_PER_PHYSICAL_CORE 0.5f +#define LOADING_THREAD_PER_LOGICAL_CORE 0.5f // Enable/disable additional assets metadata verification, note: we should disable it for release builds #define ASSETS_LOADING_EXTRA_VERIFICATION (BUILD_DEBUG || USE_EDITOR) diff --git a/Source/Engine/Content/Loading/ContentLoadingManager.cpp b/Source/Engine/Content/Loading/ContentLoadingManager.cpp index 5f75e8cd1..14f57abf0 100644 --- a/Source/Engine/Content/Loading/ContentLoadingManager.cpp +++ b/Source/Engine/Content/Loading/ContentLoadingManager.cpp @@ -165,7 +165,7 @@ bool ContentLoadingManagerService::Init() // Calculate amount of loading threads to use const CPUInfo cpuInfo = Platform::GetCPUInfo(); - const int32 count = Math::Clamp(static_cast(LOADING_THREAD_PER_PHYSICAL_CORE * (float)cpuInfo.ProcessorCoreCount), 1, 6); + const int32 count = Math::Clamp(static_cast(LOADING_THREAD_PER_LOGICAL_CORE * (float)cpuInfo.LogicalProcessorCount), 1, 12); LOG(Info, "Creating {0} content loading threads...", count); // Create loading threads