Site performance: cpu usage is high when not in a game

Hello devs,

I notice that, even when my OGS tab is not selected/visible, the overview page is always consuming 8%-12% of my CPU. It’s become a significant battery drain for me. (I didn’t look at any other pages.)

Is anyone else seeing this?

I’m on macOS 11.3, Chrome 90.0.4430.93 (Official Build) (x86_64).


Maybe this might help?

1 Like

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.


Also this

I thought that was solved but clearly not the only issue.
Maybe @borrowcheck might be able to help?

I don’t think that one was solved - did miss something saying it was?

FWIW, I believe this is what is getting called too often.

I’ve seen it in passing when I was in that area.

You will need a bravery potion to dig into why, I suspect,

(I just double checked, and that is indeed being called at something under 10Hz on an idle game page),

Oh, I see borrowcheck did submit a fix … so this thing must be “another needed”.

I think this is still related to the chat notification indicator. @rileylark made a patch that improved it a ton, but we might still need to do more - or perhaps either remove it or make it optional.

1 Like

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.

That seems reasonable, nothing pops out in my head that would be a reason for needing to constantly sort things unless you’re on the chat page.

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


In my own experience, the chat is the place where ogs freeze sometimes (Android phone+opera) or I can’t really write. (keyboard freeze or supra long to activate)

I did put that on poor performance of my phone.

Does ‘chat indicator’ mean this thing? Screen Shot 2021-05-14 at 17.49.35

If so, i would love to have the old counter at the tab for unread messages, that was far more useful than the current thing.

Yep that thing

Good to know, sounds like more optimization is needed throughout that whole system.

1 Like

Could you clarify how the old system worked? because [sic] I really like the new system as it allows me to follow only the chatrooms I’m interested in.

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)
Screen Shot 2021-05-15 at 1.47.26

Probably also that you don’t have 20 or so tabs open too so you can actually read it :smiley:

1 Like

In game chat sorting is helpful to spot strong players and pros, now they’re in the middle somewhere, a bit eh.



This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.