SchedulerHostConfig.default & SettingsHub causing SIGNIFICANT performance issues

Hi,

One of the games I am currently working on is experiencing significant performance issues for certain users caused by SchedulerHostConfig.default & SettingsHub, similar to OP. While I haven’t been able to entirely figure out the cause of them (kinda, read about the console & chat below), players are reporting that it occurs most often after interacting with user interface.

I have identified two major issues that cause SchedulerHostConfig.default to have long frame times: the Developer Console & Chat. I go in-depth below.

I have not been able to identify what causes long SettingsHub frame times but I can confirm it is affecting some of my players.


SettingsHub is changing Text and TextTransparency properties of something? I couldn’t find anything definitive in the SettingsHub.lua CoreScript that this could be.

Developer Console

After extensive testing, another user and I found that opening the Developer Console and navigating to the “Memory” tab triggers a session-lasting SchedulerHostConfig.default stutter as seen below. This stutter occurs every 3 seconds, which is the memory graph/stat update frequency. While I didn’t have time to test other tabs, I do believe the same happens to any tab with constantly updating stats. The only way to stop it is to rejoin.


Based on the namecalls & indexing (FindFirstChildFindFirstChildDisplayNameGetValueGetChildren) under this frame, I believe I was able to find where exactly in the CoreScripts this issue is occurring.

CoreScripts\Modules\DevConsole\Components\Memory\ClientMemoryData.lua

Code Explanation

For simplicity’s sake, “script” or “the script” refers to the CoreScript above.

-- Line 418
-- This function is called and begins the memory stat updating on a 3 second internval.
function ClientMemoryData:start()
	spawn(function()
		self._pollingId = self._pollingId + 1
		local instanced_pollingId = self._pollingId
		self._isRunning = true
		while instanced_pollingId == self._pollingId do
			-- GetMemoryPerformanceStatsItem calls FindFirstChild twice
			local statsItem = GetMemoryPerformanceStatsItem()
			if not statsItem then
				return
			end
			self._lastUpdate = os.time()
			-- This is where the spike happens, see below
			self:recursiveUpdateEntry(self._memoryData, self._memoryDataSorted, statsItem)

			if self._totalMemory ~= statsItem:getValue() then
				self._totalMemory = statsItem:getValue()
				self._totalMemoryUpdated:Fire(self._totalMemory)
			end

			self._treeViewUpdatedSignal:Fire(self._memoryDataSorted)
			-- 3 second interval: CLIENT_POLLING_INTERVAL = 3
			wait(CLIENT_POLLING_INTERVAL)
		end
		self._isRunning = false
	end)
end
-- Line 265
-- This matches the order of namecalls and indexes found in the spike
function ClientMemoryData:recursiveUpdateEntry(entryList, sortedList, statsItem)
	local name = StatsUtils.GetMemoryAnalyzerStatName(statsItem.DisplayName)
	local data = statsItem:GetValue()

	local children = statsItem:GetChildren()
	...

My guess is that, for some reason, the ClientMemoryData:stop() function is not correctly (or at all) called.

If the player has server console access and opens the server “Memory” tab, it seemed like they would receive a similar, additional stutter caused by an incoming packet, which I assume is the server memory information.

I can provide a MicroProfiler Capture in a PM that includes both spikes if needed.
cc @MaxCaulfield_001

Chat Issue

The FPS issue @Floo_d was experiencing with the chat is very much still present. Incoming chat messages spike my frame time from ~4ms to ~9ms; this jump increases the more messages my client receives. The length of the message doesn’t seem to noticeably change frame time.

What we did discover, however, is that quickly opening and closing the Chat window will cause your FPS to drop significantly when your mouse enters or exits the chat window. This drop will get worse the more times you close and open the chat. The more chat messages that have been sent to your client the worse the drops will be. Running ‘/clear’ does not fix the issue.

Do chat messages get reconstructed every time the chat opens without clearing the old ones? Are chat messages stored forever, and the chat tries to render all of them? I looked through the Chat CoreScripts but there’s a lot and I don’t have the time to learn and understand how it works internally.

Below is a YouTube video demonstration.

Below is a spike when I hover over the Chat.

I can provide a MicroProfiler Capture in a PM that shows frame times after hovering over chat if needed.

Both of these issues are occurring on the latest Roblox version (711) and affect both Windows and macOS.
Client CoreScript Version: 80471914653504.6237

My community is very competitive and combat-focused. They expect the games to be as optimized as possible without stutters or lag spikes.

9 Likes