pd4d10 / http-indicator

Indicator for HTTP/2, QUIC and HTTP/3
https://chrome.google.com/webstore/detail/hgcomhbcacfkpffiphlmnlhpppcjgmbl
MIT License
101 stars 11 forks source link

Causes Chrome to use > 100% CPU #13

Closed joeshaw closed 2 years ago

joeshaw commented 2 years ago

Since 1.0.0 was released I've noticed Chrome using over 100% CPU. Going through my extensions one by one I found this one to be the culprit.

It only affects the main Chrome process. I haven't noticed that a particular tab seems to trigger this. Looking at the code I don't see anything obviously amiss, and the code hasn't changed much between 0.1.0 and 1.0.0, so I'm not sure how best to debug this on my end. Suggestions welcome!

joeshaw commented 2 years ago

Running Chrome 94.0.4606.81 (Official Build) (x86_64) on macOS 11.6 (Intel)

pd4d10 commented 2 years ago

Thanks for the report. Could you provide the URL which causes this issue?

pd4d10 commented 2 years ago

the code hasn't changed much between 0.1.0 and 1.0.0

Yeah, the difference is just manifest v2 to v3, see https://developer.chrome.com/docs/extensions/mv3/intro/

joeshaw commented 2 years ago

I have ~50 tabs open, and the CPU usage is associated with the main Chrome process, not any particular renderer, so I haven't been able to narrow it down to a particular URL yet.

pd4d10 commented 2 years ago

To confirm the cause of this problem, could you please check the Chrome task manager to see if the process of this extension has the high CPU usage?

joeshaw commented 2 years ago

It's not, it's the main browser process:

image

I have tried tracking this down to a particular tab, I've tried using the DevTools on this extension's service worker to look for misbehavior (and finding none), I've tried looking at the console for each tab.

I am not sure what triggers this bug -- most recently the browser was running fine for several days before jumping to ~140% CPU and spinning up the fans. The only thing that solves the issue is to disable this extension. It may not be a bug in the extension, it may be a bug in Chrome, but I haven't been able to isolate it in any useful way.

pd4d10 commented 2 years ago

Finally reproduced it in my machine

Probably related to https://bugs.chromium.org/p/chromium/issues/detail?id=1231683

pd4d10 commented 2 years ago

Probably related to https://bugs.chromium.org/p/chromium/issues/detail?id=1231683

There seem to be no determined plans to fix this issue, so downgrade it to manifest v2 to fix it temporarily

Submitted it to Chrome Web Store, waiting for review