brookhong / Surfingkeys

Map your keys for web surfing, expand your browser with javascript and keyboard.
https://chrome.google.com/webstore/detail/surfingkeys/gfbliohnnapiefjpjlpjnehglfpaknnc
MIT License
5.21k stars 472 forks source link

Occasional High CPU Usage #1975

Open jeromebelleman opened 1 year ago

jeromebelleman commented 1 year ago

Prelude

Yes, nobody reported it before.

Error details

SurfingKeys: 1.13.0

Browser: 111.0.5563.64 (Official Build) (64-bit)

URL: Any

Context

Sometimes, Surfingkeys uses ≈30% CPU, even if I'm not doing anything, ranking as the top CPU user in the Google Chrome Task Manager. Turning Surfingkeys on and off in chrome://extensions temporarily makes the problem disappear.

brookhong commented 1 year ago

Could you please provide the URLs on which such issue will happen?

marufHasanQ commented 1 year ago

I experienced the same issue recently. Randomly it starts to use roughly 50% of the CPU. Turning off an on again solves the problem, until it comes back again.

jeromebelleman commented 1 year ago

Hi Brook,

Could you please provide the URLs on which such issue will happen?

Difficult to tell which URL triggers the problem, as I have many tabs. Can you suggest a way to tell which tab makes Surfingkeys use CPU?

Thanks,

-- Jérôme

jeromebelleman commented 1 year ago

Hi Brook,

It happened again, I closed all my tabs one by one and Surfingkeys continued using CPU even once they were all gone. The task manager showed:

image

Thanks, -- Jérôme

brookhong commented 1 year ago

Thanks for the information, then next step would be to inspect the background page of the extension, since all tabs are gone. You can go to chrome://extensions/, click on the background link on the card of Surfingkeys, it should launch inspect tool for the background page, hopefully there might be some error messages in console.

You can also build a dev version with npm run build:dev by cloning this repo, then set some breakpoints in the background to check if anything was stuck in background page(when the issue will happen next time), though I think it is impossible, since all actions in background would be triggered from Tabs, but it's worthy to try.

claimsecond commented 1 year ago

I confirm the same issue under Chrome (CPU 100% usage and overheating, cured only by stopping the extension using Shift+Esc menu in Chrome). FF and Yandex browser never went into this trouble.

jeromebelleman commented 9 months ago

Hi Brook,

I think that you can consistently reproduce the problem: type go to open a URL in the current tab, then type a string that Surfingkeys hasn't seen yet (e.g. not in the history or in any of the open tabs). No errors in the console when I inspect the background page. Are you able to reproduce it?

Thanks, -- Jérôme

brookhong commented 8 months ago

No.

image

Do you have tons of items in your history?

brookhong commented 8 months ago

It seems that @awerty-noob mentioned a similar behavior https://github.com/brookhong/Surfingkeys/issues/1689#issuecomment-1194144939 -- a non-matching input in Omnibar could trigger high CPU usage, but I cannot reproduce it. I'm wondering whether there is a special item in your history that could possibly be part of the cause.

bogdan-calapod commented 5 months ago

I'm also experiencing this on Edge/Linux - couldn't find a link between the open tabs which cause this, but if I can help with debugging let me know