diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp index e5988918f5..cb920da2de 100644 --- a/Code/Editor/CryEditDoc.cpp +++ b/Code/Editor/CryEditDoc.cpp @@ -342,7 +342,7 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename) // Register this level and its content hash as version GetIEditor()->GetSettingsManager()->AddToolVersion(fileName, levelHash); GetIEditor()->GetSettingsManager()->RegisterEvent(loadEvent); - LOADING_TIME_PROFILE_SECTION(gEnv->pSystem); + CAutoDocNotReady autoDocNotReady; HEAP_CHECK diff --git a/Code/Editor/GameEngine.cpp b/Code/Editor/GameEngine.cpp index 137d14c844..4b463efe0a 100644 --- a/Code/Editor/GameEngine.cpp +++ b/Code/Editor/GameEngine.cpp @@ -497,8 +497,7 @@ bool CGameEngine::LoadLevel( [[maybe_unused]] bool bDeleteAIGraph, bool bReleaseResources) { - LOADING_TIME_PROFILE_SECTION(GetIEditor()->GetSystem()); - m_bLevelLoaded = false; + m_bLevelLoaded = false; CLogFile::FormatLine("Loading map '%s' into engine...", m_levelPath.toUtf8().data()); // Switch the current directory back to the Primary CD folder first. // The engine might have trouble to find some files when the current diff --git a/Code/Legacy/CryCommon/ISystem.h b/Code/Legacy/CryCommon/ISystem.h index 74153eb39b..3e0abf56c6 100644 --- a/Code/Legacy/CryCommon/ISystem.h +++ b/Code/Legacy/CryCommon/ISystem.h @@ -1149,11 +1149,6 @@ struct DiskOperationInfo #endif -#define LOADING_TIME_PROFILE_SECTION -#define LOADING_TIME_PROFILE_SECTION_ARGS(...) -#define LOADING_TIME_PROFILE_SECTION_NAMED(sectionName) -#define LOADING_TIME_PROFILE_SECTION_NAMED_ARGS(sectionName, ...) - ////////////////////////////////////////////////////////////////////////// // CrySystem DLL Exports. ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp b/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp index bb2f36e69c..47029e8b51 100644 --- a/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp +++ b/Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp @@ -45,8 +45,6 @@ void CLevelInfo::GetMemoryUsage(ICrySizer* pSizer) const ////////////////////////////////////////////////////////////////////////// bool CLevelInfo::OpenLevelPak() { - LOADING_TIME_PROFILE_SECTION; - bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); @@ -69,8 +67,6 @@ bool CLevelInfo::OpenLevelPak() ////////////////////////////////////////////////////////////////////////// void CLevelInfo::CloseLevelPak() { - LOADING_TIME_PROFILE_SECTION; - bool usePrefabSystemForLevels = false; AzFramework::ApplicationRequests::Bus::BroadcastResult( usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled); @@ -190,7 +186,6 @@ CLevelSystem::CLevelSystem(ISystem* pSystem, const char* levelsFolder) , m_pCurrentLevel(0) , m_pLoadingLevelInfo(0) { - LOADING_TIME_PROFILE_SECTION; CRY_ASSERT(pSystem); //if (!gEnv->IsEditor()) @@ -297,8 +292,6 @@ void CLevelSystem::ScanFolder(const char* subfolder, bool modFolder) AZStd::unordered_set pakList; - const bool allowFileSystem = true; - const uint32_t skipPakFiles = 1; AZ::IO::ArchiveFileIterator handle = pPak->FindFirst(search.c_str(), AZ::IO::IArchive::eFileSearchType_AllowOnDiskOnly); if (handle) @@ -566,8 +559,6 @@ ILevel* CLevelSystem::LoadLevelInternal(const char* _levelName) // Not remove a scope!!! { - LOADING_TIME_PROFILE_SECTION; - //m_levelLoadStartTime = gEnv->pTimer->GetAsyncTime(); CLevelInfo* pLevelInfo = GetLevelInfoInternal(levelName); @@ -582,7 +573,6 @@ ILevel* CLevelSystem::LoadLevelInternal(const char* _levelName) m_bLevelLoaded = false; - const bool bLoadingSameLevel = azstricmp(m_lastLevelName.c_str(), levelName) == 0; m_lastLevelName = levelName; delete m_pCurrentLevel; @@ -746,8 +736,6 @@ void CLevelSystem::OnLoadingStart(const char* levelName) GetISystem()->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_LEVEL_LOAD_START, 0, 0); - LOADING_TIME_PROFILE_SECTION(gEnv->pSystem); - for (AZStd::vector::const_iterator it = m_listeners.begin(); it != m_listeners.end(); ++it) { (*it)->OnLoadingStart(levelName); diff --git a/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp b/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp index b37b257f5b..f866ee2864 100644 --- a/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp +++ b/Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp @@ -58,7 +58,6 @@ namespace LegacyLevelSystem SpawnableLevelSystem::SpawnableLevelSystem(ISystem* pSystem) : m_pSystem(pSystem) { - LOADING_TIME_PROFILE_SECTION; CRY_ASSERT(pSystem); m_fLastLevelLoadTime = 0; @@ -248,8 +247,6 @@ namespace LegacyLevelSystem // This scope is specifically used for marking a loading time profile section { - LOADING_TIME_PROFILE_SECTION; - m_bLevelLoaded = false; m_lastLevelName = levelName; gEnv->pConsole->SetScrollMax(600); @@ -388,8 +385,6 @@ namespace LegacyLevelSystem GetISystem()->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_LEVEL_LOAD_START, 0, 0); - LOADING_TIME_PROFILE_SECTION(gEnv->pSystem); - for (auto& listener : m_listeners) { listener->OnLoadingStart(levelName); diff --git a/Code/Legacy/CrySystem/LocalizedStringManager.cpp b/Code/Legacy/CrySystem/LocalizedStringManager.cpp index e4b149d84e..68e3667781 100644 --- a/Code/Legacy/CrySystem/LocalizedStringManager.cpp +++ b/Code/Legacy/CrySystem/LocalizedStringManager.cpp @@ -872,7 +872,6 @@ inline YesNoType ToYesNoType(const char* szString) // Loads a string-table from a Excel XML Spreadsheet file. bool CLocalizedStringsManager::DoLoadExcelXmlSpreadsheet(const char* sFileName, uint8 nTagID, bool bReload) { - LOADING_TIME_PROFILE_SECTION_ARGS(sFileName) if (!m_pLanguage) { return false; diff --git a/Code/Legacy/CrySystem/Log.cpp b/Code/Legacy/CrySystem/Log.cpp index 4965323695..27612bf786 100644 --- a/Code/Legacy/CrySystem/Log.cpp +++ b/Code/Legacy/CrySystem/Log.cpp @@ -397,7 +397,6 @@ void CLog::LogV(const ELogType type, [[maybe_unused]]int flags, const char* szFo } FUNCTION_PROFILER(GetISystem(), PROFILE_SYSTEM); - LOADING_TIME_PROFILE_SECTION(GetISystem()); bool bfile = false, bconsole = false; const char* szCommand = szFormat; @@ -573,8 +572,6 @@ void CLog::LogPlus(const char* szFormat, ...) return; } - LOADING_TIME_PROFILE_SECTION(GetISystem()); - if (!szFormat) { return; @@ -1187,7 +1184,6 @@ void CLog::LogToFile(const char* szFormat, ...) ////////////////////////////////////////////////////////////////////// void CLog::CreateBackupFile() const { - LOADING_TIME_PROFILE_SECTION; if (!m_backupLogs) { return; diff --git a/Code/Legacy/CrySystem/System.cpp b/Code/Legacy/CrySystem/System.cpp index d848160b3e..452ebea302 100644 --- a/Code/Legacy/CrySystem/System.cpp +++ b/Code/Legacy/CrySystem/System.cpp @@ -1044,15 +1044,12 @@ IXmlUtils* CSystem::GetXmlUtils() ////////////////////////////////////////////////////////////////////////// XmlNodeRef CSystem::LoadXmlFromFile(const char* sFilename, bool bReuseStrings) { - LOADING_TIME_PROFILE_SECTION_ARGS(sFilename); - return m_pXMLUtils->LoadXmlFromFile(sFilename, bReuseStrings); } ////////////////////////////////////////////////////////////////////////// XmlNodeRef CSystem::LoadXmlFromBuffer(const char* buffer, size_t size, bool bReuseStrings, bool bSuppressWarnings) { - LOADING_TIME_PROFILE_SECTION return m_pXMLUtils->LoadXmlFromBuffer(buffer, size, bReuseStrings, bSuppressWarnings); } diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index 08292a6353..dcfeb90484 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -432,8 +432,6 @@ AZStd::unique_ptr CSystem::LoadDynamiclibrary(const cha ////////////////////////////////////////////////////////////////////////// AZStd::unique_ptr CSystem::LoadDLL(const char* dllName) { - LOADING_TIME_PROFILE_SECTION(GetISystem()); - AZ_TracePrintf(AZ_TRACE_SYSTEM_WINDOW, "Loading DLL: %s", dllName); AZStd::unique_ptr handle = LoadDynamiclibrary(dllName); @@ -612,8 +610,6 @@ AZStd::wstring GetErrorStringUnsupportedGPU(const char* gpuName, unsigned int gp ///////////////////////////////////////////////////////////////////////////////// bool CSystem::InitConsole() { - LOADING_TIME_PROFILE_SECTION(GetISystem()); - if (m_env.pConsole) { m_env.pConsole->Init(this); @@ -662,7 +658,6 @@ ICVar* CSystem::attachVariable (const char* szVarName, int* pContainer, const ch ///////////////////////////////////////////////////////////////////////////////// bool CSystem::InitFileSystem() { - LOADING_TIME_PROFILE_SECTION; using namespace AzFramework::AssetSystem; if (m_pUserCallback) @@ -748,11 +743,8 @@ void CSystem::ShutdownFileSystem() ///////////////////////////////////////////////////////////////////////////////// bool CSystem::InitFileSystem_LoadEngineFolders(const SSystemInitParams&) { - LOADING_TIME_PROFILE_SECTION; - { - LoadConfiguration(m_systemConfigName.c_str()); - AZ_Printf(AZ_TRACE_SYSTEM_WINDOW, "Loading system configuration from %s...", m_systemConfigName.c_str()); - } + LoadConfiguration(m_systemConfigName.c_str()); + AZ_Printf(AZ_TRACE_SYSTEM_WINDOW, "Loading system configuration from %s...", m_systemConfigName.c_str()); #if defined(AZ_PLATFORM_ANDROID) AZ::Android::Utils::SetLoadFilesToMemory(m_sys_load_files_to_memory->GetString()); @@ -783,8 +775,6 @@ bool CSystem::InitFileSystem_LoadEngineFolders(const SSystemInitParams&) ////////////////////////////////////////////////////////////////////////// bool CSystem::InitAudioSystem(const SSystemInitParams& initParams) { - LOADING_TIME_PROFILE_SECTION(GetISystem()); - if (!Audio::Gem::AudioSystemGemRequestBus::HasHandlers()) { // AudioSystem Gem has not been enabled for this project. @@ -826,8 +816,6 @@ bool CSystem::InitAudioSystem(const SSystemInitParams& initParams) ////////////////////////////////////////////////////////////////////////// bool CSystem::InitVTuneProfiler() { - LOADING_TIME_PROFILE_SECTION(GetISystem()); - #ifdef PROFILE_WITH_VTUNE WIN_HMODULE hModule = LoadDLL("VTuneApi.dll"); @@ -855,7 +843,6 @@ bool CSystem::InitVTuneProfiler() ////////////////////////////////////////////////////////////////////////// void CSystem::InitLocalization() { - LOADING_TIME_PROFILE_SECTION(GetISystem()); // Set the localization folder ICVar* pCVar = m_env.pConsole != 0 ? m_env.pConsole->GetCVar("sys_localization_folder") : 0; if (pCVar) @@ -917,8 +904,6 @@ void CSystem::OpenBasicPaks() } bBasicPaksLoaded = true; - LOADING_TIME_PROFILE_SECTION; - // open pak files constexpr AZStd::string_view paksFolder = "@assets@/*.pak"; // (@assets@ assumed) m_env.pCryPak->OpenPacks(paksFolder); @@ -1153,8 +1138,6 @@ bool CSystem::Init(const SSystemInitParams& startupParams) gEnv = &m_env; } - LOADING_TIME_PROFILE_SECTION; - SetSystemGlobalState(ESYSTEM_GLOBAL_STATE_INIT); gEnv->mMainThreadId = GetCurrentThreadId(); //Set this ASAP on startup diff --git a/Code/Legacy/CrySystem/XML/xml.cpp b/Code/Legacy/CrySystem/XML/xml.cpp index d3fbaa9ec6..ccc878b8f1 100644 --- a/Code/Legacy/CrySystem/XML/xml.cpp +++ b/Code/Legacy/CrySystem/XML/xml.cpp @@ -1675,8 +1675,6 @@ XmlNodeRef XmlParserImp::ParseBuffer(const char* buffer, size_t bufLen, XmlStrin ////////////////////////////////////////////////////////////////////////// XmlNodeRef XmlParserImp::ParseFile(const char* filename, XmlString& errorString, bool bCleanPools) { - LOADING_TIME_PROFILE_SECTION(GetISystem()); - if (!filename) { return 0; @@ -1739,8 +1737,6 @@ XmlNodeRef XmlParserImp::ParseFile(const char* filename, XmlString& errorString, if (g_bEnableBinaryXmlLoading) { - LOADING_TIME_PROFILE_SECTION_NAMED("XMLBinaryReader::Parse"); - XMLBinary::XMLBinaryReader reader; XMLBinary::XMLBinaryReader::EResult result; root = reader.LoadFromBuffer(XMLBinary::XMLBinaryReader::eBufferMemoryHandling_TakeOwnership, pFileContents, fileSize, result);