cynicaloptimist/improved-initiative

Chrome high CPU/GPU utilization

Closed this issue · 13 comments

For some reason, whenever I open an II encounter in Chrome, my CPU now ramps up to about 30% and my GPU runs at about 8%. I considered this no big deal, but it makes the fan in my small laptop scream, so it is kind of annoying. I've used II for almost a year now and only noticed this issue about 2-3 weeks ago. I figured it was a problem with my laptop, but in recent debug I discovered I have near 0% utilization increase when I use MS Edge instead of Chrome. If there is more info I can provide to help debug, please let me know.

I downloaded Firefox, and confirmed no issues with it as well, fwiw. Looks like a viable workaround for me for the foreseeable future.

This is a hard one to diagnose, but it might be reproducible with a copy of your exported user data.

improved-initiative ebongo 1-6-20.txt

Renamed my JSON to .txt. Still reproducible as of this morning. I've been using Firefox in the meantime without issue.

I was looking at the issue in the Chrome debugger this morning and I noticed a few things that might help narrow it down:

  1. The issue seems to only appear with the "narrow" toolbar. My II always starts in narrow mode. When I toggle to wide, the utilization immediately goes down and stays down. If I toggle back to narrow, the app freezes up (and the high utilization re-occurs).
  2. After opening the library and starting a search, when I look closely, I can see the toolbar jittering slightly in the top half. After turning on the debugger I can see that it is constantly resizing a certain div element between 58 and 59 pixels.
    image.

So... it seems there is a key relationship with the toolbar that I didn't previously notice.

Sounds like I misconfigured the useEffect hook in Toolbar.tsx:18 maybe.

@cynicaloptimist - I regret that I'm still pretty nooby on code development, so I don't know how to test other than the released version. Should I just wait for the next release to test?

Yeah, I just made that comment as a note to myself or anyone else who picks up this issue. Not high priority yet since I can't reproduce it.

I'll deploy a build this week that might fix the issue, or will at least help me troubleshoot.

Can you still repro this? I deployed an update the other day that might remedy the issue.

@cynicaloptimist Unfortunately, the issue persists, with the same symptoms.

Ok, I've got something else to try that I'll deploy this week. Still haven't been able to reproduce it locally.

Ok, how about now?

It's fixed! Huzzah!