Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The background page to service worker change may backfire in practice #136

Open
wolfspelz opened this issue Nov 11, 2021 · 2 comments
Open
Labels
topic: service worker Related to service worker background scripts

Comments

@wolfspelz
Copy link

wolfspelz commented Nov 11, 2021

While thinking/writing on discord I "discovered" that the move to time-limit background tasks by moving them to service workers (#72) might backfire. I understand that this is a solution for a problem. But it might have unintended consequences. While this is the obvious solution, sometimes people do not react as you expect, and things develop differently. I would like to have your opinion. Maybe I got something wrong.

Any extension that wants to do compute in the background will immediately restart the background task. So, the background task will still run all the time and the change does not help. Others who need a persistent context (to store data, state or maintain a network connection) will also restart the background task AND consume additional resources doing so. In essence: the change does not achieve the desired effect and even hurts performance.

With respect to memory consumption: there might be more worthwhile targets. A typical chrome tasks list of my always open tabs shows the weblin.io extension uses 30 MB and does almost nothing even though it holds user items, avatars and manages a persistent messaging connection. Compare this with chrome core processes (1.1 GB), LinkedIn, Facebook, gmail tabs (300 MB each), and many tabs/extensions between 100 and 300 MB including Google Sheet, Google Analytics, Google Keep, Google Translate. Then tell me that the Manifest V2 extension is a resource hog, that must be dealt with.

chome-taskspng

What do you think?

(Related to the persistent-background-context-for-a-messenger-app issue #133)

@cuylerstuwe
Copy link

cuylerstuwe commented Nov 21, 2021

I agree, but I also think that this is almost so obvious as to not warrant creating a distinct issue for the topic. This backlash against the fundamental problems in MV3 is so widespread that it's easy to find several other issues that essentially complain about the same things.

@cuylerstuwe
Copy link

cuylerstuwe commented Jan 2, 2022

In response to your edit:

I pointed out some similar hypocrisies when Google announced that the in-memory chrome.storage.session API would be limited to 1MB.

Meanwhile, the New Tab Page takes up 40MB of RAM, and if I leave an instance of Gmail open, it holds onto at least around 200MB indefinitely.

These were measured on a totally clean Chrome profile, of course.

"Do as I say, not as I do."

@xeenon xeenon added the topic: service worker Related to service worker background scripts label Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: service worker Related to service worker background scripts
Projects
None yet
Development

No branches or pull requests

3 participants