Thanks, that is an improvement, from 8%-12% down to 4%-9%. If I then hide the tab (select another tab) it goes down to 0%-5%. (That’s still a lot of computation for something that is sitting in the background.)
If this were my own code, I’d want to know what it was doing all that time. I only have two games going, both correspondence games. Feels like something is working way too hard.
If you are in chat channels with 3k+ people then a lot of CPU is used for maintaining the user lists even when you are not looking at the user lists.
I did sort of a bandaid by making that list-maintenance more efficient, but it might be better to completely remove the need to sort the lists at all. In my quick explorations it seemed like maybe list sorting could be moved to the Chat view instead of the chat manager, but I didn’t go too far down that road. Lemme know if I can help with anything!
Crazy idea: remove the user list from the chat? If users currently use it to see how many people are in the channel, it could be replaced w/ a much cheaper (wrt CPU) set of indicators to answer main questions like “how many people are here,” “are my friends here,” etc.
Removing them all together might get some push back, it’s useful to know when someone is in a channel and thus likely to respond I feel. I don’t see that we’d ever need to sort them unless we’re on that chat channel page though, and we could also defer sorting to batch updates every 1s or something like that like you had proposed in the past
I didnt find any screenshots form my laptop about it, so i stole a part of what Eugene posted few years ago on another thread. (Sorry eugene for copyright infringement)
We used to have this kinda thing showing how many new messages chat has had since you last visited that tab, i found it lot nicer than the current indicator (oc it only worked if you had ogs chat in an open tab at your browser, thats prolly why we have the current thing instead this)