Reducing power consumption for background tabs
blog.chromium.org
blog.chromium.org
A big factors seems to be that the pages that are built out of layers of active advertising devices - a given advertiser isn't concerned that they're one of ten monetizing devices pasted onto a gvien page.
And there's the way pages have disincentive to play nice - a page that barely works with only it open trains users to avoid other pages.
[1]: https://chrome.google.com/webstore/detail/the-great-suspende...
That just replaces the page with blank placeholder. How hard would it be to replace the page with an image of it's contents?
I was thinking about a plugin.
For me, the title, favicon and URL are plenty to identify the page, I think it's a good tradeoff.
[1]: https://chrome.google.com/webstore/detail/the-great-discarde...
How long before a "performance best practices" guide suggests leaving a websocket open to ensure snappier page responses when users switch to your tab.
I think it would be better to give each tab a power budget that, initially, allows it to run for S seconds at full power, and that give it new budget at a rate of x < 100% of max power every second.
However, I fear that still won't be enough. The list of heuristics and exceptions could get so long that the resulting benaviour becomes difficult to explain.
After that the browser should automatically throttle and provide an API to let the web app ask for permission to use more CPU, similar to how geolocation works today.
I don't see why this should be too complicated from the user's point of view. We're not talking about hard limits or real time guarantees. Browsers have a lot of wiggle room on the implementation side.
Also, how does one control what set of pages a given permission applies to? Exact URL often will be too limited, entire domain too coarse.
Allowing a page to use lots of CPU after every user interaction may be a way out, but if you do that, you don't need the explicit permission system.
[I also think the way browsers handle those geolocation permissions already is too complex for many users. They will simply learn "click 'allow', and things will work; click 'forbid' and things may break"]
It's not hugely important. It could be DOMContentLoaded + x seconds. It could be onload unless it doesn't fire within a reasonable amount of time. As long as the browser starts throttling within seconds I don't care much about the details. Login is not a concept I find relevant in this context.
>Also, how does one control what set of pages a given permission applies to?
It should apply on a per-domain basis. That may be too coarse in some cases but nothing is perfect. Let's go for good enough.
As I enabled it, I got the normal warning about "This plugin can view all data" etc, and I started looking for a plugin that can show me what servers plugins are connecting to... it seems there is no such thing. Perhaps time to re-enable little snitch.
The Great Suspender swaps the entire page out for a placeholder until you re-activate the page.
Also link for the lazy like me:
https://chrome.google.com/webstore/detail/the-great-suspende...
Advantages over The Great Suspender: - More memory savings - Compatible with chrome tab syncing - Super lightweight extension that uses no content scripts or persistent background scripts
Disadvantages over The Great Suspender: - No visibility on which tabs have been suspended - Unable to prevent a tab from reloading when it gains focus
https://chrome.google.com/webstore/detail/the-great-discarde...
I just switched to The Great Discarder from The Great Suspender. You probably want to resume all suspended tabs back, because if you will remove The Great Suspender extension suspended tabs will get closed.
Other then that it was what I always wanted from The Great Suspender (or the browser) in the first place.
Sadly, my workaround has been to quit and re-launch browsers, which presumably has a similar effect to this update. Looking forward to seeing if the new version keeps things snappier...
chrome://flags/#expensive-background-timer-throttling
...though they may eventually remove the flag.I wouldn't mind having my background Netflix just stop, or having to wait a few secs for an interval refresh after bringing a tab to front.
But seeing as this seems an active area of research and debate I have a feeling that this solution has drawbacks I'm not considering...
Even consider the typical hackernews demo of a javascript genetic algorithm: you probably want to be able to leave it to run for a while while you do other things without being required to keep the tab visible.
Otherwise, each time you switched tabs to your spreadsheet, doc, slide show, etc., it would have to poll for changes from the server in some fashion, and wait for a response. This gets pretty frustrating when you're trying to do something like copy from one document to another.
------------------------------------------------------
Suspend all background tabs (~2018) Fully pause a tab in the background after N minutes unless a web developer states that the tab should continue to run via an explicit opt-out.
Remove opt-outs (~2020+) Remove the opt-out and pause all pages. We’ll be able to do this once we’ve (1) ensured that the web platform provides the APIs needed for major use cases and (2) given developers a sufficient deprecation period.
------------------------------------------------------
That sounds a bit scary, and would require a lot of rewriting or refactor existing code. I'm assuming not all the APIs are even ready yet to proactively start doing this already. But sounds like the iOS model, which has it's pros and cons. Probably has a lot of benefits though in the long run.
I hope by pause, means if they switch back it resumes instead of reloading/refreshing. Maybe even emit an event to know it resumed, if the app wants to check if new notifications, etc for it's view... Maybe you were filling out a complex game form - losing state would really be sucky if it reloads, instead of resuming.
I have a service that's used daily by a small community of people who are behind such a proxy. The service uses 10 second javascript timeouts to fetch new data from the server - This change in Chrome(ium) is going to totally break it.
I do agree that sockets are the way to go, I just don't think the rest of the internet infrastructure is completely there yet.
Does that mean simply using vanilla socket.io means the page will not benefit from this?