Live data from Hacker News

Chrome will aggressively throttle background tabs

blog.strml.net

231–240 of 403 posts

Re: Chrome will aggressively throttle background tabs

#231

Hi, this is Alexander. I'm an engineer on Chromium team working on scheduling and on background tab throttling in particular. Firstly, I want to make clear that we are not shipping this in Chrome 56. We have enabled throttling as an experiment in beta channel to measure impact and collect feedback from web devs. We will aim to ship it in Chrome 57, subject to further feedback. In response to concerns voiced we will d…

Hi Alex, I appreciate your work. My macbook air is getting pretty slow and this is the best free performance boost I could ask for. keep up the good work.

Re: Chrome will aggressively throttle background tabs

#232

Hi, this is Alexander. I'm an engineer on Chromium team working on scheduling and on background tab throttling in particular. Firstly, I want to make clear that we are not shipping this in Chrome 56. We have enabled throttling as an experiment in beta channel to measure impact and collect feedback from web devs. We will aim to ship it in Chrome 57, subject to further feedback. In response to concerns voiced we will d…

Pinning a tab has the side-effect of shrinking its title bar to just the icon. I use the text on there to communicate alerts / information to users. (Maybe pinned will enlarge if document.title is changed or something don't know never use it). So hopefully there is another way. To me `site settings` `Throttle this site when in the background, Warning: this may slow your machine and consume additional battery resources`

To me the fundamental issue is one of user control. If the user wants the site to run in the background, great. However a lot of times they don't even know that it is and, surprise! the battery is drained, or everything is running slow and it's time to press shift+esc and stare at the jumping percentages in the task manager.

So to that end, communicating what's going on to the users, is I think pretty important so hopefully:

* A Visual Indicator on the tab, similar in spirit to the speaker or red recording circle, that conveys

  1. Tab is fully utilizing its throttle.

  2. Tab has throttling disabled by user-request.
And then to give users control:

* The ability via `site settings` to disable the throttling, however if a site is using excessive background resources, some sort of ui should show indicate such.

(A lot of this would be almost trivial by showing little cpu use bars, with a line where the throttle is, but it might look kind of ugly)

Even though this is going to break some of my apps, I can see a greater good here, and I am 100% for helping out with battery life, and preventing my machine from being some sort of ad network computation shard. So I am fine with this being the default option even though it will break apps I have written. They are mostly in house tools so as long as I can instruct users to override the throttle, provided I am given that option, which it seems like I will be.

I would figure that for larger more public facing devs, the experience might be a bit more tedious. Perhaps a unthrottled-background permission request API can be done. And hopefully for legacy sites that won't be updated, the visual indicators above will clue users in as to fact that the browser is throttling the site. Perhaps ugh I hate even suggesting this, a nag bar could pop up when the user navigates back to the tab to inform them that the site was aggressively throttled.

Anyhow, I am glad you guys are getting out ahead of this, I think this stuff is going to get worse as sites seek to run more code on our machines in ways we cannot easily discern. So I actually don't like that workers / websockets / audio work around aggressive throttling, because the bad actors are just going to use that to burn cpu in the background without the users consent. Hopefully if executed well, with a helpful ui, this can be used to stop any unwanted and often unseen but still felt cpu waste while allowing sites the user actually does rely on to continue working.

ps, I'll cross post this to your tracker as well as you requested, I just know that leaving it here will get more eyeballs from a larger community to give their feedback as well.

Re: Chrome will aggressively throttle background tabs

#233

Earlier quoted context omitted.

A common use-case is tabs that are streaming music. I'm not sure if most users are even aware of pinned tabs.

I use pinned tabs extensively and I prefer that they are throttled even more aggressively than standard open tabs. As long as streaming doesn't break. I have an option set in FF's about:config that disables loading of my pinned tabs on startup, so I regularly keep 200-300 tabs open and only activate the ones I need. Sometimes it takes weeks to clear my tabs because I barely see a performance hit from having so many o…

Unfortunately this doesn't seem to be the way most users are using pinned tabs. Check out the great suspender. The only tabs it does not freeze are the pinned tabs.

Extending that functionality to throttling seems natural to me.

Re: Chrome will aggressively throttle background tabs

#234

Earlier quoted context omitted.

I meet many tab hoarders (always open a new one, never close any, ending up with hundrets), but just can't wrap my head around it! I hate having more than 6-7 simultaneously open because it gets increasingly harder to keep an overview of what you're doing. The same applies for IDE tabs or windows. Too much of them and finding the right one becomes increasingly hard, and losing the thread more likely.

There might be a more effective way to accomplish what I do with many tabs, but it works for me at the moment so I haven't attempted to find a browser plugin or extension to change the behavior. I use many tabs as a stack of pages when debugging, researching, or reading aggregate news feeds (reddit, hn). It usually starts with a Google search or two, in which I open all links I think _might_ be relevant based off of…

For tree tab view, I suggest looking at Tabs Outliner. I can't use Chrome without it anymore.

Re: Chrome will aggressively throttle background tabs

#235
post #216
post #196

Earlier quoted context omitted.

Not the greatest solution, considering Pinning isn't documented anywhere and most Chrome users have no idea it exists. Which is a shame, as pinning is probably my favorite browser feature.

I'd use Pinning a lot more if it didn't shrink the tab down to its Favicon size. Wish it would also prevent you from closing the tab.

FYI: You can still close the tab, just not by clicking the (no longer visible) X. This may not fit your use case, but then again it might (I can't remember the last time I closed a tab by clicking instead of with ctrl+w).

Re: Chrome will aggressively throttle background tabs

#236
post #216

Earlier quoted context omitted.

I'd use Pinning a lot more if it didn't shrink the tab down to its Favicon size. Wish it would also prevent you from closing the tab.

+1. I just now found out about it. Tried it, saw the tab reduced to a favicon, and will probably never use it till that's fixed. Especially with how a Gmail Tab blinks when I get a hangout message.

> Especially with how a Gmail Tab blinks when I get a hangout message.

The pinned tab for GMail has a blue dot for "attention needed". Though this is suboptimal because I think it represents both IMs and new mail.

Re: Chrome will aggressively throttle background tabs

#237

I run a real time charting platform for Bitcoin traders (like those using BitMEX) and the app does a lot of updating/refreshing. I recently learned of the visibilitychange API and managed to make huge improvements in the app's performance when running in the background - on the order of ~75% reduction in CPU usage when running in the background. [1] var doVisualUpdates = true; document.addEventListener('visibilitycha…

Wow that's a great tip, I did not know about that one, but it's going to be very useful for a UI I am about to start working on.

In addition to requestAnimationFrame this could be very handy!

Are there any gotchas you have experienced in using this API that I should look out for?

Re: Chrome will aggressively throttle background tabs

#238
As a bellweather, OSX has had something called App Nap for some time, which throttles hidden apps apart from certain activities like playing music or downloading. I would imagine it affects Chrome as well as Safari. Have there been any real problems with that in practice?

Re: Chrome will aggressively throttle background tabs

#239

Earlier quoted context omitted.

If a page signals it's desire to opt-out of aggressive throttling, the user should be notified of this, perhaps by an icon in the tab, so that we can either close it or force the throttling. I'm a laptop user and CPU-hungry background tabs are a huge drain on my battery life. If something is opting out of or otherwise excluded from throttling, I want to know about it. Thanks.

I agree. I prefer it throttle everything but ask me if a page is important enough. A news site isn't important enough to ask for this but Slack is.

To be honest neither is slack. They've got push notifications through web service workers. What for would they need aggressive background activity?

I'm not saying this to be pedantic, just trying to nip this entitled vendor mentality in the bud. "We're important so give give give without asking." It's a bit what you see with permissions on mobile: the more famous a company is, the more brazen a permission policy they can get away with. It's only tangentially related actual functionality of the app.

This is not about you personally, by the way, but about vendors. You just shouldn't let them get away with it. Even if they're slack :)

Re: Chrome will aggressively throttle background tabs

#240
post #216
post #196

Earlier quoted context omitted.

Not the greatest solution, considering Pinning isn't documented anywhere and most Chrome users have no idea it exists. Which is a shame, as pinning is probably my favorite browser feature.

I'd use Pinning a lot more if it didn't shrink the tab down to its Favicon size. Wish it would also prevent you from closing the tab.

Also there are some sites that don't work well with pinning, including G Suite. I'd love to have pinned tabs for work email, work calendar, personal email, and personal calendar. But every time my session expires, they all get redirected to login pages.
Post reply on HN