diff --git a/lib/cli/daemonutility.cpp b/lib/cli/daemonutility.cpp index bb951b17d..9e910f313 100644 --- a/lib/cli/daemonutility.cpp +++ b/lib/cli/daemonutility.cpp @@ -247,6 +247,11 @@ bool DaemonUtility::LoadConfigFiles(const std::vector& configs, return false; } + // After evaluating the top-level statements of the config files (happening in ValidateConfigFiles() above), + // prevent further modification of the global scope. This allows for a faster execution of the following steps + // as Freeze() disables locking as it's not necessary on a read-only data structure anymore. + ScriptGlobal::GetGlobals()->Freeze(); + WorkQueue upq(25000, Configuration::Concurrency); upq.SetName("DaemonUtility::LoadConfigFiles"); bool result = ConfigItem::CommitItems(ascope.GetContext(), upq, newItems);