My game has been receiving lag spikes ‘recently’. The most obvious change I’ve made in the past few weeks was moving from the old chat system to ‘TextChatService’.
Asking some users for microprofile dumps, I can see that ‘Heartbeat/delayedThreads/Script_CoreScripts/ExperienceChatMain’ and ‘Heartbeat/delayedThreads/Script_Unknown’ are using >13ms of frametime very frequently. I do not believe I am doing anything out of the ordinary with the chat system. These lag spikes are having a negative effect on my game’s UX.
I can see calls to ‘GetFastFlag’ so I am confident that this is an issue with core scripts and not my game scripts.
Apologies but do you have a time frame? I’d love to use the new TextChatService system but I’m being forced to remove it. I’m getting a large amount of annoyed players saying they refuse to play with the amount of performance loss the new chat system is causing
Every one of them seems to be getting 8ms+ of frame time from the ExperienceChatMain core script whenever bubble chat is used.
EDIT: Seems like a recent update may have broken LegacyChatService’s bubble chat system, at least in Studio. I cannot get it to work in any place.
I just wanted to provide a quick update. We’ve released several fixes aimed at improving the performance of various modules in ExperienceChatMain, which should improve performance for most users. We have a few other fixes in the works that we hope to release sometime this month. While we haven’t found a one-size-fits-all solution to resolve these performance issues completely, we are continuously working on incremental improvements.
If you don’t mind sharing, what exactly is making the new chat system slow? From an outside perspective, we’ve been confused as to what exactly is making this so much of an issue, given that a chat system implemented in Lua can get by fine without any hitches.
ExperienceChatMain for some reason still take a lot of time when you’re in a server with a lot of players and your device is under heavy load and there are people chatting and you’re typing in the chat too. But the lag spikes would still happen even if you don’t type in the chat or send any message. Here I played Doors in my Samsung Galaxy M12 phone at the maximum graphics quality level with Future Lighting, people were chatting in the lobby and I was typing in the chat too, the game was extremely slow and laggy, and for some reason ExperienceChatMain took a lot of time (over 100ms at times!).
I am not sure if this is expected or not so I just decided to post this in case it isn’t.
Edit:- I don’t notice any huge spikes when I am in a private server and just typing myself without anybody else in the server other than me, in fact ExperienceChatMain tag doesn’t even show at all in the Microprofiler like in here:-
To add to this, I’ve tried playing Multi-Crew Tank Combat 4; a game that uses the Legacy Lua Chat System on my Samsung Galaxy M12 phone at the highest graphics quality level, with Future Lighting and this is how it looks like:-
I don’t think they’re going to fix any bugs with the legacy chat unless it’s a major bug since it is deprecated and is no longer being maintained. For example there is this bug report about “.Chatted Randomly Firing Twice in Public Experience Only” and there was a response from an engineer saying that they’re no longer maintaining the legacy chat system and won’t be able to fix the bug.
It would be fair if Roblox would bring back the missing features from the legacy chat system to the new TextChatService like tab support for example and fix the bugs and the performance issues with it. They literally want games to migrate to the new TextChatService without working out on why they aren’t doing so. I believe more games would migrate to the new TextChatService if the missing features and the bugs and performance issues got fixed.
I also want to add that spam opening the chat box still result in huge spikes from ExperienceChatMain mostly in servers with a lot of players. This is not related to VideoCaptureService:GetCameraDevices()
This system is entirely built in Lua / React (although I think it was built using Roact and then put onto react-lua via roact-compat). I’ve forked a (slightly older, like 5 month old) copy to see if I could fix the performance issues and it is fairly challenging.
The chat loops through a large number of Adornees on Heartbeat, and given it’s run entirely in serial this eats up a huge chunk of CPU time at once, which tanks player FPS.
When I forked the BubbleChat though, I disabled the normal BubbleChat and it had no performance impact on ExperienceChatMain!
It looks like it has something to do with the UserProfiles module, I suspect being called for every player who has Chatted. Unfortunately nothing I can do to fix this except to revert back to Legacy chat since this is a critical issue for my game.
“React is a great idea for all of our core UI” - Statement dreamt up by the utterly deranged
This is captured from 1 minute of gameplay where no messages were sent nor was the chat window even shown. An empty chat accounts for HALF of our processing time. And this call graph is insane, how could you possibly need so many functions to (not even) display some text in a window?
It’s almost like the framework was made for a completely different medium. Oh wait…