From 53c33f344cb58f8b541f9560e152a9ec5cf91752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 25 Sep 2023 19:41:14 +0200 Subject: [PATCH] Benchmark loading and saving config --- Core/Config.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 7223678f0e..5e065e7c39 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1068,6 +1068,8 @@ void Config::UpdateAfterSettingAutoFrameSkip() { } void Config::Load(const char *iniFileName, const char *controllerIniFilename) { + double startTime = time_now_d(); + if (!bUpdatedInstanceCounter) { InitInstanceCounter(); bUpdatedInstanceCounter = true; @@ -1209,10 +1211,11 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { PostLoadCleanup(false); - INFO_LOG(LOADER, "Config loaded: '%s'", iniFilename_.c_str()); + INFO_LOG(LOADER, "Config loaded: '%s' (%0.1f ms)", iniFilename_.c_str(), (time_now_d() - startTime) * 1000.0); } bool Config::Save(const char *saveReason) { + double startTime = time_now_d(); if (!IsFirstInstance()) { // TODO: Should we allow saving config if started from a different directory? // How do we tell? @@ -1291,7 +1294,7 @@ bool Config::Save(const char *saveReason) { ERROR_LOG(LOADER, "Error saving config (%s)- can't write ini '%s'", saveReason, iniFilename_.c_str()); return false; } - INFO_LOG(LOADER, "Config saved (%s): '%s'", saveReason, iniFilename_.c_str()); + INFO_LOG(LOADER, "Config saved (%s): '%s' (%0.1f ms)", saveReason, iniFilename_.c_str(), (time_now_d() - startTime) * 1000.0); if (!bGameSpecific) //otherwise we already did this in saveGameConfig() {