Script_CoreScripts/ExperienceChatMain Very Slow

Hello @be_nj

Apologies for the bump.

Unfortunately the issue still persists and goes far beyond the execution times previously mentioned. We’ve had a surge in our player base as of late on Kaizen’s Origami and CoreScripts/ExperienceChatMain execution time appears to scale overtime, requiring clients to rejoin after only spending 20 minutes in the game. Execution times soar to over 500ms after an hour in a 70 player server. This causes the game to become unplayable to users.

Eventually, numbers start looking unrealistic as shown in the screenshot below. TextTransparency and TextStrokeTransparency appear to be the main culprit.


This is a screenshot in an early session before it gets chaotic. CoreScript/ExperienceChatMain appears to have many calls in this period. (Again, the ms grows over time resulting in larger lagspikes)


I’ve attached a profiler dump here:
microprofile-20260216-080051.zip (1.8 MB)

I’ve also used the script profiler and trace it down further. resetTextTransparency seems to be quite expensive.

Disabling customizations seems to have no effect.

The spikes seem to happen the second chat messages are received through MessageReceived on the client. The length of the message determines the spike duration.

I hope this can be solved as it is a big inconvenience to our player base which has been growing recently. Please let me know if there is anything I might be doing wrong here.

6 Likes

I’m also experiencing major issues but this bug in my experience is quite weird and is sporadic…

This could be entirely unrelated but given that the experience Chat Window and chat messages are involved and are affecting performance; I can’t help but think these bugs may be related in some way? (the microprofiler shows a ton of Transparency related calls…)

I will try to see if I can find out a possible cause, but at this point it seems completely random to me.

The only observation I’ve been able to make is that it occurs after awhile of playing, the frame drops are subtle at first (lasting under a second or just a second) but then they get unbearably bad after 30+ mins of playing.

For whatever reason, it is especially bad in my experience that I am working on - it’s different to other roblox experiences and I can’t tell if it’s something I’m doing wrong.. All the spikes are from Roblox’s corescripts. (SchedulerHostConfig.default, SettingsHub, rarely ExperienceChatMain)

8 Likes

Following up on this with a repro!

I have now tested it in an empty baseplate and found that the results were unidentical. Additionally, I’ve found a way to force the lag spikes to appear within the first minute by flooding the chat using TextChannel:DisplaySystemMessage().

The repro floods the chat for one minute (This is used as a way to simulate being in a server for ~30 minutes). Afterwards, performance drops can be evaluated as it simulates regular chat by sending a message every 0.1-1 second. Each message will cause a lag spike from now. This seems to only work in live games and does not work when tested in Studio.

The repro experience can be found here. The experience isn’t copy-locked, so the source can be evaluated.

This client script is the only script needed.

local TextChatService = game:GetService("TextChatService")
local Channel: TextChannel = TextChatService:WaitForChild("TextChannels"):WaitForChild("RBXGeneral")

local function generateMessage()
	-- Generate a message with length within chat requirements
	local messageLength: number = 200 -- math.random(1, 200)
	local message: string = string.rep(
		string.char(
			math.random(65, 90)
		),
		messageLength
	)
	
	Channel:DisplaySystemMessage(message)
end


-- Flood the chat with messages each frame for 3600 frames (~1 minute) to simulate a long session
for i=1, 60 * 60 do
	generateMessage()
	task.wait()
end

-- Simulate regular player chatting
while true do
	task.wait(math.random(0.1,1))
	generateMessage()
end

As a reminder, my computer has a Ryzen 5900x, RTX 3080, and 32GB RAM. The effect is noticeable regardless of the hardware.

Here’s a video after a minute, where the chat would slow the game down even if message rate is low.

10 Likes

Mainly any kind of interaction causes this, for whatever reasons
Such as even starting to chat causing it

One way to fix the performance would be to have our own chat, but sadly roblox made this be against the TOS

2 Likes

Managed to catch this today. Happening pretty consistently across playtesting.
This entire spike is just RobloxChatMain. Not sure what causes it, but we have bubble chat and ChatTranslation turned off.

3 Likes

When will this be patched? It’s insufferable to play an experience with this terrible issue.

2 Likes

There is a silly workaround for not having these lag spikes at all; turning off Roblox chat in your account’s settings. Doing this completely fixes the issue for me, and is a bonus for those who have chosen not to verify in order to gain access to chat :slight_smile:

2 Likes