Another reproduction
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!).
Microprofiler logs:-
microprofile-20240802-162306.html (1.2 MB)
microprofile-20240802-162933.html (1.2 MB)
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:-
microprofile-20240802-163638.html (1.2 MB)
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:-
microprofile-20240802-173003.html (1.5 MB)
May I please add that the legacy chat has some errors that occur randomly in studio with ChatMain:
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.
Well that’s kind of unfair? Alot of games require legacy chat rather than the new version.
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.
But obviously they don’t, because the comapny is so cheap that even with billions of dollars they can’t afford to just hire some people to do so.
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()
microprofile-20240808-111704.html (1.8 MB)
microprofile-20240808-112400.html (6.0 MB)
I don’t know what did the fixes that got released fixed because nothing really got fixed. The same performance issues remain.
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.
Seems that focusing on the chat as well as typing in the chat also cause lag spikes.
“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…
I see this issue a lot in plugins that use Roact, where the plugin has the tiniest functionality (like an icon pack menu) and the actual file is 90% roact modules which in this case is, essentially, bloat.
I understand why Roblox would want uniformity in their newer core UI, but I strongly believe using heavy frameworks like this is what’s causing delays for basic fixes, like the player list scrolling being buggy for over a year.
I am still experiencing this. It’s caused a huge drop in concurrent players over the past 6 months. Many users are reporting losses of 66% in their FPS before I made the change. It is imperative that this issue is resolved before TextChatService is made a requirement. My game takes around 3ms to do all local logic while both the new chat and leaderboard take a combined 15ms+! I have users reporting less than 25fps with the root cause being the performance of the new chat system.
This needs to be fixed. It is unacceptable, especially after having the issue made known for over 8 months.
Here’s a clip of the performance in action:
External MediaIt is absolutely appalling for 200FPS to be nuked down to 40FPS due to chat.
For anyone experiencing this, this post may be relevant Client Locking Up On Humanoid Death - #9 by Cuyler.
The gist is that you should check if your game has Workspace.SignalBehavior
set to Immediate
. If it does, try changing it to Deferred
. All issues relating to lag from ExperienceChatMain and other CoreScripts was resolved and most users in my game reported 2x to 3x frame time (FPS) improvements.
This is definitely still an issue with the Engine though, Immediate
signal behavior shouldn’t tank frame time that much.
Unfortunately this isn’t a universal fix. For example, all of my instances of complaints have been from Checho’s Deltarune RP - Roblox and this has SignalBehavior set to Deferred
Yeah, I’ve had a few people bring it up however I’m wondering if they’re using bloxstrap? I think a few users in my game were using it and that was causing issues with FastFlag settings which may be defaulting to Immediate signaling.
The system absolutely needs to be optimized still!