
Chrome will aggressively throttle background tabs - callumlocke
http://blog.strml.net/2017/01/chrome-56-now-aggressively-throttles.html
======
artursapek
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('visibilitychange', function(){
          doVisualUpdates = !document.hidden;
        });
    

Basically, you can use this to determine if your tab is running "in the
background" and avoid redrawing/refreshing components to show updates that
won't ever be seen.

[1]
[https://twitter.com/cryptowat_ch/status/817502626896089090](https://twitter.com/cryptowat_ch/status/817502626896089090)

~~~
daveheq
Why should the browser rely on the webpage developer to tell it to not redraw
things in a tab that isn't the visible one? The browser by default shouldn't
redraw content in a tab that isn't visible. This seems like the most obvious
thing in the world.

~~~
odbol_
Because some websites might still need to work when not in focus. E.g. If you
are showing animations or videos in a window, but the user wants to answer an
IM in another window without interrupting the animations.

~~~
72deluxe
But then if you switch windows or tabs, the timer for the animations in the
tab that is now invisible can be stopped, surely??

Why redraw an invisible window? In any ordinary paint routine, you query for
the invalidated rectangle and only redraw what you must. In the case of pages
that are out of view, then nothing needs redrawing.

Processes that are busy doing things they need not (like redrawing on a timer,
polling a mouse) is why Apple starting highlighting offenders in macOS (what
is hogging the battery??) and why I don't use Chrome on it - it just gobbles
power keeping all of those tabs alive.

Hopefully these new changes will help.

~~~
artursapek
OP here. In my case, the CPU saved was mostly React updating its virtual DOM.
Yes, the browser doesn't do repaints when the tab is in the background. But
there's plenty of other work that is done before repaints when using a library
like React.

------
altimin
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 disable aggressive throttling when
active websocket connection is present. Tabs playing audio are already
unthrottled.

We will also consider more signals to use in exempting a page from this
throttling: metatag, pinned tabs, permission to show notifications from user.
Please leave a comment in the bug (crbug.com/650594) if you have other
suggestions.

Looking forward to your feedback, Alexander.

~~~
mjevans
I'd like to see the user better informed of hot (active) tabs. Just like
there's an audio icon to help the user track down which tab is making noise,
there should also be some mechanism to let the user know that a tab is more
active than usual.

I'd recommend a different background color for the tab, except that I'd also
like to see (sign in) profiles have distinct background colors to aid the user
in keeping their profiles straight.

~~~
cr0sh
Color change on the tab would be nice - maybe have it slowly grow more red
(and perhaps add an option to change the color as well - for colorblind folks)
- then start blinking - then burst into flame...

~~~
mvindahl
I think Samsung tried that approach

------
mcescalante
It's awesome to see Chrome trying to improve performance for people with many
tabs open, which is many of us.

I use a LOT of tabs, and the best plugin has been The Great Suspender. Highly
recommend it for anyone who wants memory & CPU back and keeps many
tabs/windows open at once: [https://chrome.google.com/webstore/detail/the-
great-suspende...](https://chrome.google.com/webstore/detail/the-great-
suspender/klbibkeccnjlkjkiokjodocebajanakg)

~~~
blauditore
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.

~~~
cortesoft
When I am doing coding work, I often have a ton of tabs open. I will keep
different documentation tabs open to the relevant sections. I will keep some
tabs with answers on StackOverflow.

My open tabs are kinda like my working memory. I could close them and reopen
them as needed, but it is easier to just click a tab then to try to find the
thing again. In addition, sometimes the pages I am looking at have dynamic
navigation, and closing and reopening the page will require a good deal of
navigation to find the section I was looking at. Plus, the overall time to
reload the content, where if I just have the tab open there is no download
time.

Also, the tab icons help me remember what I was looking at. I will often keep
tabs open for what I wanted to read later.

~~~
blauditore
Yeah, I basically do the same thing, but that hardly ever requires 10 tabs for
me. When that happens, finding tabs becomes especially harder once their width
starts to shrink.

As for read-later, I usually pull them into the bookmarks bar (top level,
directly visible) to free up some space.

~~~
visakanv
I use one-tab.com; works fantastically for me. Not a huge stretch to say it
changed my life.

~~~
blauditore
For what it's worth, there's a similar feature currently available in Firefox
Test Pilot: [https://testpilot.firefox.com/experiments/tab-
center](https://testpilot.firefox.com/experiments/tab-center)

~~~
reitanqild
Are you taking about tab center? That thingy had a number of issues last I
checked, I especially remember there was something weird about the layout of
it. I think it extended all the way up on the side of the menu bar. This
looked weird to me (and I think UI is overrated) and makes the toolbars slide
when I open/close the tab drawer.

I'd recommend using one of the extensions instead.

------
lucb1e
I like the change as a general idea but there obviously needs to be a manual
override. Like, I don't want websites to access my camera without permission
but obviously I want to allow _some_ websites to do that. A similar permission
could be used here and is perfectly backwards compatible:

1\. a tab exceeds its quota and throttling kicks in;

2\. you visit the tab to check why it stopped working;

3\. you get a permission pop up (like all others) once you visit the tab
again, asking you whether you want to allow it unlimited resource usage,
noting that it'll decrease battery life of your device.

~~~
josu
Or just ask for the permission when you first open the page, the same way uber
asks for your location.

www.foobar.com wants to:

"Run in the background unthrottled"

~~~
pmiller2
That's less "backward compatible" than the suggestion to pop up a dialog on
switching to the page, because the page needs to know to ask for the
permission.

I'm not sure if that's a good thing or a bad thing. After all, backward
compatibility is how we got the semantics of an alert() dialog stopping all JS
execution.

~~~
rhizome
These days, due to my annoyance with pages reloading themselves when switching
to a tab, I'm really not interested in packing more functionality into the
whole tab switching mechanism. Like the back button, it should not be visible
to web developers.

------
dumbmatter
What are we supposed to do about stuff this? Like I wrote a video game
[https://play.basketball-gm.com/](https://play.basketball-gm.com/) that lets
you open multiple tabs for viewing multiple screens even while simulation is
occurring in another tab. But Chrome recently stopped running the simulation
if it's in a background tab. Putting my simulation code in a Shared Worker
would be nice, except Safari and IE will never support it and it seems likely
to be deprecated soon. Service Workers kill anything that takes over 30
seconds, so no long running processing allowed. What do I do? Go back to
writing desktop apps that nobody will install?

~~~
EvanAnderson
It would be dodgy hack, but another HN comment made reference to a statement
that tabs playing audio are always considered "foregrounded":
[https://groups.google.com/a/chromium.org/forum/#!topic/blink...](https://groups.google.com/a/chromium.org/forum/#!topic/blink-
dev/-dmrNAFHd-4/discussion)

~~~
TheRealDunkirk
Their own Google Play would be impacted otherwise. Good to hear, since the
only thing I use Chrome for is Google Play (and any other, one-off, old-
fashioned sites which require Flash). Why in the world does Google still
require Flash for... anything?

------
drinkjuice
How about displaying more info about the "weight" of a page, when it comes to
downloaded assets, cookies / local storage, RAM and CPU usage? I know there
are ass backwards and fugly ways to see all of that, but why can't I see a
list of all open tabs, with columns of such info which I get to define and
sort as I please? Why not have the option to that info pop up when hovering
over a tab, and to show notification icons for certain thresholds, user
definable with sensible defaults? There's a lot of things browsers should be
doing. So what if 100 people don't care; the one person that does become more
aware of what is going on more than makes up for it. *

And just let us allow tabs to grab all the resources they want on a opt-in
basis. Why not?

* Before anyone brings up the inevitable economic argument - it wouldn't take a lot of man hours to do these things, I dare say it would just take one or two persons who are capable to be willing and _allowed_ to do them. And compared to all sorts of things that browsers vendors made and get scrapped, you at least know tabs will always use ram, CPU and load assets over the network, so it's not ever going to be completely useless.

~~~
Phlarp
You do know that Chrome has a task manager that will display memory, CPU and
network usage for each tab right?

~~~
drinkjuice
Yeah, make that "allow docking the task manager". Though I still miss a total
about how many bytes got downloaded, average speed etc. I also miss it in
other browsers (though I should have made that more clear, I wasn't meaning to
"bash Chrome" \-- this frustrates me since the departure of old Opera, with
all browsers, I love the powerful web API stuff but I hate the user interface
directions).

And to repeat myself, I really do miss something akin to the icon that
displays which tabs are playing sound -- not for myself, but because it would
allow people to notice the difference between bloated and well crafted pages
more easily.

I appreciate they prefer to automatically decide what is best, but I would
prefer more gauges, at least as an accessible option. If you hide something
behind an "advanced" label, it will just scare people off for no reason. It's
not like configurations dialog aren't kinda barren and padded as is. Just fix
that and then just put things there, neatly categorized and maybe even
searchable, and explain them. People can drive cars and vote for politicians,
but we can't trust them to read? Just about any image viewer or video player
seems to think more highly of people than browsers of all things do.

------
nialv7
This is of course a really good thing, but I feel this is not enough.

The browser has increasingly become universal platform. On the one hand, this
means applications written for browsers are automatically cross platform. But
this also makes the browsers more and more complicated. Even the simplest
webpage takes a significant hit in resource usage.

Maybe we need some sort of "reduced web". A browser that only supports the
essential features to display webpages. No WebGL, canvas, notification,
WebRTC, locations, WebMIDI, or WebUSB (seriously!). And I don't mean just
disable these features, but rather design the browser without them. Then we
could do most of our browsing in the minimal browser, and only fire up chrome
for the more demanding web apps.

~~~
dredmorbius
FYWD:
[https://ello.co/dredmorbius/post/ubkidr7yuc7azg9hdnl7lq](https://ello.co/dredmorbius/post/ubkidr7yuc7azg9hdnl7lq)

------
steego
Personally speaking (That means I'm speaking for myself), I could absolutely
care less about the plight of the developer who wants their page to run stuff
in the background.

If you really think I should be running something in the background, you
should ask Chrome for that permission so Chrome can ask me. If I say yes, then
feel free, but no website should have this for free.

~~~
BinaryIdiot
> no website should have this for free.

Why not? Your applications on the desktop can run background tasks without
your approval. Your phone's applications on iOS and Android can run background
tasks without your approval. The web has _tons_ of web applications some of
which more complex than stand alone apps. So why wouldn't they be afforded the
same?

Asking would be a bit of a UX nightmare. You'll have so few users enable it.
It's a pattern they've never seen before.

~~~
saurik
> Your phone's applications on iOS and Android can run background tasks
> without your approval.

Apps on iOS can only do this for a short time interval before they will
receive a SIGSTOP and are no longer allowed to execute at all; and while you
can react to push notifications, you are given a very limited time interval in
which you can do that locally. You can manage downloads in the background, but
those are passed off to a dedicated download process to make sure you aren't
doing anything complex (as a download should not be a major CPU drain: it is
really just something that has to respond to I/O events). You can play audio
or track location actively in the background, but the system makes this
_incredibly obvious_ by placing an omnipresent and highly intrusive banner at
the top of the screen, telling you which application is doing that. You can
manage bluetooth devices in the background, but if you are paired with a
bluetooth device then the user probably understands what is happening.

------
vdnkh
This is going to destroy HLS playback in a background tab. Playing back HLS
with JS is already a very cpu intensive, time-dependent process and we've
already struggled with the current background tab throttling - a delay like
this will all but kill playback or make it stutter to the point you'll wish
it's dead instead. I commend Chrome for driving web standards but they've been
a huge bully recently.

~~~
Spoom
I don't believe it will. From
[https://groups.google.com/a/chromium.org/forum/#!topic/blink...](https://groups.google.com/a/chromium.org/forum/#!topic/blink-
dev/-dmrNAFHd-4/discussion) :

 _Background tabs usually do not have a visible impact for user (tabs with
audio are always considered foregrounded)._

~~~
croddin
Is that a workaround/loophole then? A tab can play silent or very quiet audio
and then run unthrottled?

~~~
Ambroos
Chrome's audio detection is quite smart if I'm not mistaken. A tiny amount of
sound is usually seen as 'silent' too, since it'd be practically inaudible.

------
overcast
Can we aggressively throttle memory usage? Why does it require 300-500MB of
ram PER TAB?

~~~
brandon272
Does Chrome only use RAM if it thinks it is available? (i.e. if it starts
detecting that other process are running and eating up RAM, will it use less?)

~~~
Klathmon
It does try to reduce what it can in low memory situations (less "pre"
optimizations like prefetching, prerendering, even dns prefetches and stuff,
V8 gets more eager to throw out "potentially unneeded" code, tabs get
suspended and written to disk, heuristics can get shut off, etc...), but it
can't change what the page does.

If a browser tab wants to store 300MB of data in RAM, or wants to throw a
shitton of stuff at the DOM, Chrome needs to oblige.

------
dirkg
Why can't Chrome add 'reload tabs only when focused' ??!!!

A simple, trivial feature that's in every browser on Earth, except bloody
Chrome.

Its been requested pretty much forever and Chrome takes a perverse delight in
ignoring the most requested features, because of course they know better than
their users.

other examples - multi row tabs, customizable fonts, and actually giving a
damn about memory usage.

Chrome is a memory hog and instead of optimizing that, the solution is to kill
background tabs. This is very similar to Android's logic - instead of trying
to fix rampant 'Android system' and 'Play services' wakelocks which cause
massive battery drain, the fix was to forcefully suspend apps via Doze, which
of course ignores the real problem entirely.

------
jwilk
Archived copy that doesn't require JS:

[https://archive.fo/3ph1z](https://archive.fo/3ph1z)

~~~
joemccall86
Excellent work! Kind of funny the article mentions

> This will break the web.

But apparently blogger requires javascript just to render static content.

~~~
STRML
Oh, it's awful, I agree. This is the nicest layout but the JS is terrible.

I've reverted to a plain-HTML layout.

~~~
STRML
To whoever downvoted this: I am the author of the post above, and in response
I've removed the JS-centric layout.

~~~
Neliquat
Thanks! Not a stickler, or one of the complainers, but I appreciate less
scripting, and responsive devs. ;)

------
tbrock
This is great. Remember that most people will benefit from this change and I
love that Google is being aggressive about it.

If your backgrounded browser app needs 100% of the CPU, you've made a mistake.

------
JoeCoder_
Why not have a "this page would like to perform work in the background
[allow|block]" notification?

~~~
ryandrake
I'd guess it's because most users would have no idea what to choose, would
have no idea what the affect of each choice would be, and if you add more text
to explain it, most users will not read it. Pop up the notification too often
and it becomes a nuisance.

Better IMO to bury the choice deep in settings or something, for power users,
if you even offer the choice at all.

~~~
drinkjuice
> I'd guess it's because most users would have no idea what to choose

Sounds like you could kill two birds with one stone: allow a non-lame web
_and_ encourage users to learn what that means. We can't complain about tech
illiterate users with one corner of the mouth and then make them decide what
goes with the other.

> if you add more text to explain it, most users will not read it

They're not users. They're the blight on the back of users. Why cater to them?
Is someone who looks left and right before crossing the street a "power
pedestrian", too?

" _This tab wants to use a lot of [RAM /CPU/GPU] while it is in the
background, is that cool with you?_

 _If you don 't know what this means, it's best to select no. Fuck that site
anyway for using a lot of resources without making it obvious that it's doing
something heavy, or asking first, or explaining what is going on. If they
don't like users clicking no or even navigating away from the page, that's
their problem. If you read this far, click here to claim your Avid Reader
Achievement Trophy._"

Not bad for a first draft?

~~~
gr3yh47
> They're not users. They're the blight on the back of users. Why cater to
> them?

actually they are about 90%+ of users

[https://www.nngroup.com/articles/computer-skill-
levels/](https://www.nngroup.com/articles/computer-skill-levels/)

~~~
drinkjuice
Fine, and most "webmasters" are really just hack frauds. On my planet, it's
their job to get a room and ours to burn it.

edit: Usage implies intentionality. Intentionality implies awareness. Not
being some super guru, but more awareness than "is text, won't read".
Therefore, while the drive to shovel hardware on people, to create needs you
then get to fill, did indeed bring all sorts of people who now get called
users to the table, I don't consider them such. It's like someone who has a
seizure on dance floor is not dancing, or like someone you forced to be
somewhere is not "visiting that place". And I know people don't find it rude
to just ignore a claim of how something _ought_ to be with "but this is how it
is, which is why it can and must be that way", which is why I say what I say.
If someone does bad things and won't discuss them, it's absolutely up to the
people who are aware and care to act. If you don't understand poetic language
unless it's flowery that's your problem. So yes, I stand by what I said, just
not by what it might evoke in the minds of some readers.

~~~
jamesgeck0
This sounds a lot like the arguments in the 80s about how GUIs were bad
because they let anyone use a computer. Empathy makes it easier to write good
software.

------
Aardwolf
Pretty annoying if you want a game to continue running in the background :/

~~~
discreditable
Just what I was thinking. RIP Cookie Clicker.

~~~
ajanuary
Wouldn't Cookie Clicker be doing updates based on time deltas? There's no
guarantees a timer will fire after the desired time even without this update.
Or am I missing a feature that requires it to be able to continually process
in the background?

~~~
discreditable
CC only runs while you have its tab open. I'd assume there's some function
that updates state regularly (even if it's only the regular auto-saves).

------
niftich
The Intent to Ship [1] writes that all six platforms will be affected
(Windows, Mac, Linux, Chrome OS, Android, and Android WebView). Yet how does
this affect Chrome OS background tabs, which _" work entirely in the
background and run even after you close the Chrome browser"_? [2]

[1]
[https://groups.google.com/a/chromium.org/forum/#!msg/blink-d...](https://groups.google.com/a/chromium.org/forum/#!msg/blink-
dev/XRqy8mIOWps/LvBUbWbxAQAJ) [2]
[https://support.google.com/chrome/answer/1184722?hl=en](https://support.google.com/chrome/answer/1184722?hl=en)

------
nraynaud
That's a pain in the butt, I wrote a cnc toolpath computer and I don't want
the computation to stop while you browse reddit

------
ogig
Can't we use serviceWorkers to workaround this? That's what they were created
for.

I have a webaudio side project that works nicely even on the background using
serviceWorkers for timing. I'm hoping it will be the same on 56.

~~~
judah
Can you elaborate? What does service workers give you for your web audio
project that doesn't work without service works?

I'm curious because I have a HTML5 audio web app that works great, except when
running on mobile in the background.

~~~
ogig
In my project the serviceWorker only has a setInterval that will trigger the
main loop.

When the setInterval was in the main code it would slow down, a lot, when the
tab was on background. That made the generated music go slow aswell. With the
serviceWorker the clock is rock solid, even when the background app can't keep
up, the timing is solid.

------
xg15
Seems to me this is still just an intent-to-implement, i.e., the discussion
about the feasibillity of the feature and the exact implementation details is
still very much ongoing. It might be useful to contribute to the discussion at
[1]. An outline about the implementation details is given in [2].

The dev team also acknowledges this is a breaking change for the web and
considers it an "intervention" according to [3]. This admittedly doesn't mean
much, but at least gives some basic standard of procedure that sites can
follow to keep impact on a minimum.

Also noteable is this bit from the current discussion: _We mitigate this by
only throttling timer tasks; other tasks such as loading tasks will continue
to run unthrottled._

Sounds to me as if this could mean that IO events are not effected. So sites
that currently poll for notifications in the background might work around the
throttle but using long polling or web socket push instead.

[1]
[https://groups.google.com/a/chromium.org/forum/#!topic/blink...](https://groups.google.com/a/chromium.org/forum/#!topic/blink-
dev/-dmrNAFHd-4/discussion)

[2]
[https://docs.google.com/document/d/1vCUeGfr2xzZ67SFt2yZjNeaI...](https://docs.google.com/document/d/1vCUeGfr2xzZ67SFt2yZjNeaIcXGp2Td6KHN7bI02ySo/edit#heading=h.fu3qclnznmk5)

------
r1ch
This is probably a good thing in the long run. Timer-based callbacks can
generally be replaced by events, which only trigger when there is actually
work to be done. Many JS timers I've seen are needlessly busy-polling.

Whether this implementation affects just timer callbacks or all background
processing (eg websocket data events) is a bit ambiguous - this blog post
seems to suggest major apps like Slack and Discord will break, but surely they
are using websockets and not continuously polling for new data.

------
khc
There was an firefox extension that did this as well, but it's been
discontinued:
[https://github.com/palant/suspendbackgroundtabs](https://github.com/palant/suspendbackgroundtabs)

I wrote my own script that does this:
[https://github.com/kahing/bin/blob/master/throttle](https://github.com/kahing/bin/blob/master/throttle)

------
cabalamat
> Popular applications like Slack and Discord, as well as our own application
> (BitMEX, a Bitcoin trading site) will be hugely and adversely affected by
> this.

Good, if web apps will become less reliant on doing everything in the server,
so I will be able to open up multiple tabs without slowing down a computer.

Finally, a reason to move to Chrome! (Currently a Firefox user)

------
andre3000
About time. I have been using extensions such as one-tab to prevent background
tabs from draining memory.

~~~
recursive
I've got some bad news for you. This change has nothing to do with memory
consumption of background tabs.

------
jankotek
I am surprised nobody mentioned battery saving mode in Opera. It throttles
background tabs similar way, but not so aggressively.

This will be great thing. Right now my Chrome eats about 10% of CPU, mostly
Skype, Slack, Calendar... With Opera it is bellow 1% and I get much better
battery life.

~~~
rasz_pl
Even in Opera it is less about throttling cpu usage, and more about coalescing
wakeups/timer interrupts.

There should never be a situation where background tab cant even get a 1
second timer running reliably, unless its trying to compute pi at the same
time.

------
kbd
> Unfortunately, this implementation is ignoring the new reality: the browser
> is no longer just a reading device; it is the world's largest application
> platform.

This is why browsers really need to focus more on letting web pages be
applications. On mobile, you can "add to home screen" for a web page and
that's expected behavior. That needs to be forefront on the desktop as well.

I have over half a dozen SSB applications using Epichrome on the Mac, but that
requires a level of technical expertise (finding and downloading a third-party
program, finding icons to use, knowing that this capability exists in the
first place, and so on) that you can't expect from average computer users.
(Epichrome is great btw.)

------
gwbas1c
Honestly, we have to come to terms with what browsers are good for, and what
they aren't good for.

For a lot of the situations that I see complaints about; I wonder if they
really should have written traditional thick applications instead of a browser
application.

------
jrockway
Seems like Edge also plans to do this:
[https://github.com/WICG/interventions/issues/34](https://github.com/WICG/interventions/issues/34)

------
divanvisagie
Love how the one commenter already found a workaround:

Olivier TilleJanuary 24, 2017 at 8:28 AM

>That shouldn't be a problem as apparently "tabs with audio are always
considered foregrounded". Source:
[https://groups.google.com/a/chromium.org/forum/#!topic/blink...](https://groups.google.com/a/chromium.org/forum/#!topic/blink-
dev/-dmrNAFHd-4/discussion)

UnknownJanuary 24, 2017 at 8:53 AM

>And there's your workaround. Loop a 1 second null audio file for as long as
you need to (please don't).

------
soheil
Each tab should get a certain number of credits to use CPU cycles, like a
ticking time bomb when it runs out it should detonate and self-close (or just
stops updating.) Perhaps then the browser in the next request to the same URL
sends a header notifying the server that its page ran out of credit in x
amount of time so the author can optimize it.

Another idea is to look at other Chrome users activity pattern in regards to
how often a given URL is kept hidden and revisited to determine how much
throttling should be done to it, something like an AdBlock list.

------
amq
A setting to only allow this when the machine is on battery would be nice.

~~~
Filligree
I often use my laptop while it's connected to power.

I still want to throttle (or suspend) background tabs, because the laptop gets
uncomfortably hot otherwise.

~~~
ponyous
An option to disable this would be nice. Some people are using PCs and don't
care about battery/temperature.

I just can't imagine tons of games that are out there working nicely. New
release is estimated to land on 31 January[0], how the hell are people
supposed to update their codebases?

[0]:
[https://www.chromium.org/developers/calendar](https://www.chromium.org/developers/calendar)

------
richardboegli
This has now been delayed:

Unfortunately, our current implementation throttles WebSockets. Because of
this we ARE NOT SHIPPING this intervention in M56.

The current plan is to disable time-budget background timer throttling for the
pages with active connection (websocket, webrtc and server-sent events) and to
ship in M57 (subject to further feedback). We will keep you updated with the
progress.

[https://news.ycombinator.com/item?id=13504385](https://news.ycombinator.com/item?id=13504385)

------
dsr_
This sounds a lot like the problem Android had with background tasks.

Starting in KitKat, a batching mechanism was introduced, so that apps which
declared that they wanted CPU or screen resources in the future didn't all
have separate timers running, but instead became members of a class that
wanted similar things.

One of the most effective features of Greenify, a battery-saving app, is to
force all apps (or all apps minus a few that you designate) into the batching
mechanism.

~~~
izacus
Yep, and Android 6.0 Doze even expanded this mechanism to be more aggressive
which proved to provide huge battery savings.

------
codedokode
They should have done it long time ago. The pages today contain a lot of
third-party scripts (advertisement, tracking, etc) and they sometimes can use
up to 100% of a CPU core.

Mobile browsers are already stopping background pages because otherwise the
phone's battery would be drained in hours.

Unless a background page is doing something useful for user, it should not
consume any CPU time.

------
abalone
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?

~~~
therealmarv
Safari, yes. Chrome no. (You can see it in the task manager)

~~~
om2
There haven't been problems with it in Safari as far as we know. We also do
additional throttling at our level in addition to participating in App Nap on
a per-tab basis.

------
lstroud
What if something like a QOS tag were established for the page author to
declare their need for a higher priority? The browser would also need to
display an icon on tabs that have requested higher priority so that users can
close sites that are abusing the privilege.

------
therealmarv
I want most aggressive battery savings possible on macOS. AFAIK Safari is
doing more aggressive things. We are still a huge step away from Safari
battery consumption although I see step by step progress made by Chrome team.

------
haddr
I'd he happy to suspend (and even offload to swap) some tabs from time to
time. Too many times I get almost unresponsive tabs where I want to do
something but it is just too laggy due to other tabs occupying the cpu.

------
tarikjn
I wish Chrome would also allow changing tabs when a page issues an alert
notification. Further, there is no reason that alert notifications other than
document/data saving, should prevent closing a tab.

------
usernam
Related: is there a decent FF extension to stop _all_ JS activity in firefox
in background tabs?

I really don't want any JS to be running in background. This _includes_
WebWorkers and ServiceWorkers.

------
daveheq
"Browser vendors should be concerned about battery life"... On a desktop or
laptop plugged into the wall? Sounds like an incomplete or counter-productive
optimization.

------
AndyKelley
The browser is the new OS. Some applications should run in the background,
some shouldn't. The user should be able to control it. Make it a permission.

------
CGamesPlay
So you get to use 1% CPU, effectively. The timer test seems strange, why was
your "simple setInterval" using so much more than 1% CPU?

~~~
extesy
No, you don't get to use 1% CPU. That would still work. The problem is that
you get to use 100% of CPU but only 1% of the time.

~~~
tantalor
Explain how that is different?

~~~
STRML
It's different because it can't just slow down a running task.

Say you use up 150ms of CPU time. Chrome isn't going to let another timer fire
for 15s. Then, you're late on a whole bunch of work that needs to get done, so
the next timer takes 500ms. Chrome then throttles the next timer by 50s. And
so on and so forth...

~~~
tantalor
But if your script had 1% of CPU, that 150ms workload would take 15s to
complete. Then the next workload would be late in the same way and take 50s to
complete.

How is this different?

~~~
STRML
It depends on what you're doing. If you split up tasks and interleaves them
(such as: process a few items, stop, set another timer, process a few more),
actual CPU% throttling would be better. It would be easier to have certain
timers take priority, such as heartbeat responses or notifications.

------
kruhft
How appropriate the day after finding the Task Manger in Chrome for the first
time yesterday. Finally got my fan to turn off on my laptop.

------
brian-armstrong
What if my page has getUserMedia/microphone access? Do I still get throttled
even if I'm not playing any sound?

------
compuguy
For people (like my parents) who open way to many tabs, this will be a big
help. Obviously there are a ton of caveats.

------
tonylemesmer
Can't they just have an enable / disable button with a warning about battery
life?

------
notadoc
All browsers should have an option to do this.

As long as you can turn it on and off, no big deal.

------
Nirvanachan
Is this feature enabled on the beta channel of Chrome builds?

------
toodlebunions
Sounds good, would be better if it's adjustable.

------
DaveSchmindel
So long to listening to Spotify ad-free at work...

------
satyajeet23
Switched to Safari, happier than ever.

------
mzzter
finally~ But I would prefer if background tabs didn't pre-load at all.

------
amerine
Good.

------
_Codemonkeyism
YES!

------
logicallee
I would like to see Chrome utilize what I think is the right solution for
loading background tabs; I would like it to let you (when you want to) rather
than OPEN a background tab, only ENQUEUE a background tab -- opening it only
when that tab becomes active, meanwhile keeping it in the status of an
"enqueued" (i.e. barebones) tab with that URL in the tabs menu until you
actually make it active or it becomes active the way any other tab would, at
which point it loads - in other words a lighter kind of background tab that
does not load at all until it becomes active.[1]

If this were implemented then finally I could open 120 tabs in a window for a
detailed query (and they're not all loaded, there's zero overhead), then after
11 minutes of reading a few of those tabs, closing the ones I've read and
having others load in their place if they weren't already loaded, be left with
87 unopened tabs with which I could close, since I've learned everything there
is to know about that subject and I don't feel the need to read the rest
anymore: I feel I've found the answer.

As it stands I can become an expert in any subject accessible in a day or two,
in twenty minutes - unless, as sometimes happens, Chrome gets in my way. I can
do it by opening them in background tabs today - but Chrome will both slow
down and also be at high risk of crashing completely, not just in the window
I'm in but all windows. Because at the moment even the 99th background tab,
which I want to open so as to potentially glance at, actively, fully loads
even if I close that window before I ever want to glance at it.

Along the same lines, I strongly feel there needs to be a way (not necessarily
the default way) to open private (incognito) windows in a way that opens them
privately _" Except for crashes"_ \-- meaning that these tabs remain open
until _I_ close it, by clicking the X button, not whenever Chrome crashes -
which usually happens when it's done using all my memory.

If you fundamentally _disagree_ that there is a distinction between the user
actively exiting and you crashing unexpectedly, then you might as well change
the Incognito greeting text to "Pages you view in incognito tabs won’t stick
around in your browser’s history, cookie store, or search history after you’ve
closed all of your incognito tabs _or Chrome crashes unexpectedly_ ".

But that doesn't make much sense. So please make the functionality match what
was promised to the user, and keep pages open until the user has closed closed
all incognito tabs. Not you.

I feel that these changes would improve people's experiences drastically.
Chrome's developers surely care about their users and want to give them the
best possible experience, and in addition this would get Google more clicks,
more traffic, more ads from Google search results, by letting people open more
pages with abandon on a lark, or on some thread they want to explore. By
letting people keep more pages and searches open or queued for opening.

For the second point (about keeping incognito tabs on disk until they are
actively closed with an X, at which point deleting them) - this also gives
their users what they've just been promised. Whereas, at the moment in
Incognito stuff just disappears whenever Chrome decides to crash -- which is
often, given that at the moment it aggressively eats memory for any tab anyone
might want to follow. This _substantially_ increases the cost of exploring the
web by opening background tabs. It makes people really weigh whether they want
to open a background tab: it adds friction.

The web is about links. I hope Chrome will start letting people follow more of
them and not lose their trail if they don't want to keep it in their history.
This would be a positive change for all users, but, especially, the heaviest
and most thorough users of the web, who load and visit the most pages. Now
they could open even more in a browsing session, without having to think about
whether they really want to risk opening another tab. (In terms of resources.)

For all of these reasons, I hope Google will implement enqueued tabs.
Separately, at the user's option, I hope tabs status will be kept on disk
until the last incognito tab is closed manually by the user (at which point
it's scrubbed with random data), so that upon a crash it can be re-opened
unless the user presses an X to _that_ window. It would improve the experience
of using the web for anyone who wanted it and not deprive users of the reading
they worked hard to assemble for themselves. And it would increase the
velocity with which users could explore the web.

Thank you.

\--

[1] Functionality. Right-click a link, click "enqueue", this should be the
same as "open in background tab" except the tab is really kind of like a
placeholder, just consisting of a URL. It's not a full background tab that
opens, gets its window name, etc - instead, it is not loaded until you
actually make the tab active.

Right-clicking the tab bar should give you the option (in addition to normal
options) "Close all enqueued tabs", leaving just tabs you've fully normally
opened.

Example usage: say I'm searching for an article. I can start by doing some
obvious Google searches in a few different tabs. I can go through the results
and enqueue each one. Then I can go through the first (when it becomes the
active tab, it is loaded) and enqueue any links that might lead to what I
want. Then I close the now full-fledged tab when I'm done reading and
following links, the next tab becomes active (which might have been an
enqueued tab in which case it becomes loaded for the first time) and I can
keep doing my search. Eventually I've found the page I'm looking for and can
close all of the enqueued pages, or perhaps drag the tab into a new window (as
you can today) and then close the old window - disappearing all the enqueued
pages but also the normal, fully loaded tabs, per the normal behavior closing
a window. (An enqueued tab is just a semi-loaded tab, just a URL that never
loads until the tab becomes active. If its window or itself is closed in the
way you usually close a tab - by right-clicking and clicking "close tab" or by
middle-clicking on it, before it was ever the selected tab, then it simply
wouldn't have even loaded a single time.)

This is exactly what I do today: except I have to be careful that Chrome
doesn't crash while I do it, because it doesn't do it gracefully. I would like
to manually specify whether I want the background tab to be actually loaded.

------
akjainaj
Oh god, please change the title. It's about timers, not bandwidth. I was
already imagining streaming music from Spotify and having hiccups all day.

~~~
halomru
They throttle timer activation frequency if you use too much CPU time (with
the goal of throttling CPU usage). How is the title not accurate?

~~~
sleepychu
It is confusing. I thought it meant network throttle till I read the post.

------
mempko
This is their plan. Google will charge companies for extra processing time on
your own computer.

------
dingo_bat
Why though? I run Chrome on my decently powered laptop and most of the time I
am connected to AC power. I want the machine to run as close to full potential
as possible. This is not a mobile phone that needs to preserve battery by
killing every background process. It's frustrating because no other browser
matches chrome in smoothness and bug-free-ness, so I have no option but to
tolerate the trademark anti-user behavior from google.

Firefox y u sux so much?

~~~
fixermark
I run Chrome on a decently-powered desktop, and too many tabs can still kill
it.

This is a good default; too many websites are built under the assumption that
they're the only thing open and they have infinite resources to burn. Granted,
I'd like to see more configuration options before this hits primetime, but I
think it's going in the right direction to force some discipline on pages if
the developers don't code it in (especially since there are events to tell
when you've gone background).

~~~
dingo_bat
> too many tabs can still kill it

"Kill"? Does your desktop stop responding and show a BSOD? How many tabs do
you have open when that happens?

I don't know how heavily people use their Chrome but for me, ~50-100 tabs
across ~5 windows across 3-4 virtual desktops seems to not hinder my laptop at
all. It's very responsive and no crashes. To be honest I've never seen a
system getting "kill"ed due to too many tabs.

My usage does not involve many video/audio tabs though. It's mostly lots of
text pages and the usual mailboxes etc.

I think browsers should follow a similar paradigm for background tabs as the
OS follows for background apps, ie, both have an equal share on resources
unless foreground apps start slowing down due to background activity.

~~~
fixermark
Kill performance. It's 2017; if you're running Win10, BSODs nowadays almost
always mean you have a legitimate hardware failure or you're actually working
on developing drivers. The OS has gotten very robust against the kinds of crap
application-level software can pull to crash the OS.

It is not yet bullet-proof against a process deciding that it deserves all of
your CPU and so much RAM that the disk cache needs to thrash to support it.

