Text in chat window causes lag
Description
hi, This is most noticeable in the post game chat when people are upset with the outcome of a match, but in general writing a lot of text in the dota client chat rooms causes the client to feel really unresponsive for everyone who has it open. The lag can be immediately fixed by typing /clear or closing the tab.
Feel like the text rendering isn't performant and likely also renders text that isn't longer visible.
Reproduction:
- open dota
- create a private chat room, don't need anyone else to be in it
- start copying some lorem ipsum
- note how the fps starts dropping
- type /clear
Feel like the behavior changed a bit since the last time I tested this, but it still causes the client to freeze for a second or two every time I paste a new line.
I can open a text file with several gigabytes of text and scroll just fine. I don't see a good reason why my PC shouldn't be able to handle a basic chat window in the client.
It is still text rendering.. There is no particle engine running to display the chat, if it does that is a major bug. Also a cache should never make things slower, that would be another bug.
I have a high end PC (Intel i7 11th gen + 3080) and I still run into this issue.
Basically the issue exists on any chat window - post game, party chat, guild chat, user created channel etc.
If there are a lot of messages being sent, the whole client becomes unresponsive and laggy. Not sure if rate of new messages is also a factor or not.
Sorry didn't see this issue when I logged mine. This didn't happen in previous years and my computer is more than capable of running the game at good FPS. But I often write down Roshan timer and want to go back and reference it but when I open chat my FPS eats shit :/
This issue is consistent enough for me that I've seen people in my party intentionally spam post-game to annoy the enemy team (and us, in our party)
It is still text rendering.. There is no particle engine running to display the chat, if it does that is a major bug. Also a cache should never make things slower, that would be another bug.
again. Text rending in game is not a TEXT FILE. IT is a visual rending. News flash, your PC has limited caching and a limited caching is allocated to each app. This is not a bug.
Both need to be rendered. It is obviously a bug.
Setting for users to set a limit on visible lines of text in a chat room. It's a great idea. Hope Valve added this.
Just fix the performance issue, sometimes having the history is fun.
Please reproduce this bug with console command enabled



I'm not able to reproduce this problem effectively.
The fps started out at around 60. After a bit of lorem ipsum copy paste I now get a small freeze whenever the text area gets updated. Either from writing a new line or just moving my mouse over my name.

If you still can't reproduce it, we can try joining a channel together.
hope this works:
https://user-images.githubusercontent.com/5174562/171938768-764ec247-b6f2-4b4d-8e5f-4c8506fe8859.mp4
I have a high end PC (Intel i7 11th gen + 3080) and I still run into this issue.
Basically the issue exists on any chat window - post game, party chat, guild chat, user created channel etc.
If there are a lot of messages being sent, the whole client becomes unresponsive and laggy. Not sure if rate of new messages is also a factor or not.
Intel 11th gen is hardly high end, friendo.
This happens in almost all post-game chats. I also found the same mini freeze happens when you open/close the ingame chat (by pressing enter) if there is a lot of text.
This issue happens much more severely if you spam emojis, especially moving/animated ones.
Here's a repro video:
https://user-images.githubusercontent.com/7711239/179392063-88dc5f89-ad1e-40bf-9ac7-f8a8d34ad505.mp4
The video shows that as I spam the :spin: emoji, my frames drop from 130 fps to 5 fps. My CPU's temperature increases from 80 C to 92 C. The moment I close the chat tab with the emojis, everything returns to normal.
We played against a team that spammed long lines of animated emojis in all-chat in the drafting phase. Everyone's frames dropped to about 5 FPS. I had to tell my teammates about /clear or we would've been unable to play.
Two possibly related issues where chat causes lag:
I get micro-stutters every time a message is posted in a global chat (like regional chats and guild chats). I've had to leave all regional chats to not get freeze-ups in-game. They only last for maybe 100 ms, but it's enough to be very noticeable and impacts gameplay. I've been using dota_chat_disable_refresh_user_list 1 and dota_chat_allow_global false as a partial workaround.
Likewise, in-game, if you let the chat history grow much bigger via dota_hud_chat_history_lines 99 then FPS drops massively as the game goes later and there's been more chat. I've personally set dota_hud_chat_history_lines 3 as a workaround to get higher FPS, although it means some chat messages scroll out of view too quickly and get lost.
This issue still occurs as of today. It's been in the game for a long time now.
I'd guess there's likely some O(bad) code running every time a new chat line gets added, and it scales with the number of lines already added.
This issue also existed in CSGO when spamming the text chat in the main menu, I also am experiencing this in dota as well, when someone else spams a chat I'm in it will also drop my frames on a really good pc so trolls can abuse this as well
This is fixed with the update we just shipped.