24 ms·
Chrome will aggressively throttle background tabs
- drinkjuice 10y agoHow 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 10y agoYou do know that Chrome has a task manager that will display memory, CPU and network usage for each tab right?
- drinkjuice 10y agoYeah, 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.
- TheRealDunkirk 10y agoYes. The browser is slowly becoming it's own operating system. Like Oracle making a bare-metal version of their database, pretty soon, Google will just skip ChromeOS, bundle Chrome with a storage driver, input driver, and video and sound drivers, and be done with it.
- dejawu 10y agoIt's not everything you asked for, but as it stands Chrome does have a task manager (Shift + Esc) that shows CPU usage, Memory, and also how the tabs are grouped process-wise.
- drinkjuice 10y agoI know, but you can use Chrome for a million years, and have resource hogging tabs crash your computer, without ever knowing about that. Even ("X seems to be slowing down your computer, press shift+ESC for a detailed breakdown") would help. The point is for abusive sites to stick out and have that imaginary free market, with the rational consumers and their informed decisions, do the rest.
- rhizome 10y agoBy the by, why we can't switch to a tab from the task manager is a question for the ages.
- TeMPOraL 10y agoWhat I'd like is popping up plain warnings aimed at regular, non-tech user. "These tabs are currently slowing down your computer: <list>." Or, "This tab uses a lot of battery power." Besides directly providing information that is relevant to a typical user, I'd hope such a solution would finally put some pressure on the companies to optimize their webpages.
- andre3000 10y agoAbout time. I have been using extensions such as one-tab to prevent background tabs from draining memory.
- recursive 10y agoI've got some bad news for you. This change has nothing to do with memory consumption of background tabs.
- akjainaj 10y agoOh god, please change the title. It's about timers, not bandwidth. I was already imagining streaming music from Spotify and having hiccups all day.
- hiimnate 10y agoTabs playing sound are exempt from the limiting https://groups.google.com/a/chromium.org/d/msg/blink-dev/XRqy8mIOWps/Btb4o__1AQAJ https://groups.google.com/a/chromium.org/d/msg/blink-dev/XRq...
- halomru 10y agoThey 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 10y agoIt is confusing. I thought it meant network throttle till I read the post.
- NTripleOne 10y agoSpotify's web player uses flash anyway.
- dumbmatter 10y agoWhat 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?
- drinkjuice 10y agoAs a workaround, in the meantime, have you tried using several windows, not just tabs? Of course, none of them can be minimized, but they can be covered by other windows and should still run.
- EvanAnderson 10y agoIt 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-dev/-dmrNAFHd-4/discussion https://groups.google.com/a/chromium.org/forum/#!topic/blink...
- dumbmatter 10y agoI think I might actually try this lol
- NTripleOne 10y ago...that would explain why flash files with no sound seem to 'pause' (or at least, run very, very slowly) when in a different tab.
- TheRealDunkirk 10y agoTheir 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?
- overcast 10y agoCan we aggressively throttle memory usage? Why does it require 300-500MB of ram PER TAB?
- tambourine_man 10y agoIt probably doesn't. Measuring memory usage is hard on a modern OS. I'd guess there's a lot of shared memory between tabs
- overcast 10y agoIf it doesn't, then why does it grind to a halt eventually on both Mac and Windows? Firefox suffers from the same nonsense as well. In fact, Safari seems to be the ONLY thing I can keep open for more than a day without a process restart.
- cookiecaper 10y agoYou're doing something wrong. I use Chrome on Windows as my main now and I usually have more than 100 tabs open. I just switched a few months ago from Firefox on Linux, also usually with 100 tabs or more open. Both are very stable. Chrome is worse with handling tons of tabs, but I certainly don't have daily crashes. People who have extremely unstable/inconsistent experiences with these platforms usually have a rogue extension or some other problem lurking beneath the surface. Also consider occasionally VACUUMing your browser's DBs, and on Firefox, taking advantage of the profile reset option.
- overcast 10y agoFor every person that has my symptoms, there is someone to counter it. I'm not going to get into an argument about how I'm using my browser incorrectly. Every computer / browser combo I've ever used exhibits the same thing, and I'm pretty religious with keeping things trim and clean.
- mulrian 10y ago
- jwilk 10y agoArchived copy that doesn't require JS: https://archive.fo/3ph1z https://archive.fo/3ph1z
- joemccall86 10y agoExcellent work! Kind of funny the article mentions > This will break the web. But apparently blogger requires javascript just to render static content.
- STRML 10y agoOh, it's awful, I agree. This is the nicest layout but the JS is terrible. I've reverted to a plain-HTML layout.
- STRML 10y agoTo whoever downvoted this: I am the author of the post above, and in response I've removed the JS-centric layout.
- simcop2387 10y agocould have been a fat finger someone had on the button. i upvoted you to help.
- Neliquat 10y agoThanks! Not a stickler, or one of the complainers, but I appreciate less scripting, and responsive devs. ;)
- vmateixeira 10y agoAwesome service! Thanks for sharing :)
- romuloab42 10y agoApparently archive.fo also requires JS via CloudFlare: Please turn JavaScript on and reload the page. DDoS protection by CloudFlare Ray ID: 326502e238204c96
- Aardwolf 10y agoPretty annoying if you want a game to continue running in the background :/
- dawnerd 10y agoOr what about having facebook messenger in a tab? Or really any site that's constantly polling.
- angryasian 10y agomany sites allow for push notifications
- Bartweiss 10y agoI've seen several waiting games already that choke on Chrome, and have settings to activate a worker that keeps them unthrottled. Looks like this will break all of those solutions.
- discreditable 10y agoJust what I was thinking. RIP Cookie Clicker.
- ajanuary 10y agoWouldn'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 10y agoCC 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).
- mcescalante 10y agoIt'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-suspender/klbibkeccnjlkjkiokjodocebajanakg https://chrome.google.com/webstore/detail/the-great-suspende...
- Analog24 10y agoSeconded. Chrome used to crash ~1/month on me but ever since I started using The Great Suspender I haven't had a single incident and it's been well over a year.
- creeble 10y agoFantastic tip, thx!
- mark242 10y ago+1 recommendation for The Great Suspender. Works like a charm, noticeable difference on overall system performance.
- ausjke 10y agosame here using The great suspender, how does this throttle thing relate to the suspender?
- mcescalante 10y agoIf you are using The Great Suspender, chances are that background tabs are going to be fully suspended so the aggressive throttling isn't even needed. tl;dr - Great suspender is even "more aggressive" than the outlined throttling, as it fully suspends the page and returns all CPU and RAM to you, so it's a great solution for people interested in throttling background tabs.
- RandyRanderson 10y ago
- nraynaud 10y agoThat'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
- tonylemesmer 10y agoCan't they just have an enable / disable button with a warning about battery life?
- ogig 10y agoCan'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.
- Someone1234 10y agoNo. They aren't cross browser compatible or backwards compatible. They work fine in latest Chrome and kinda work in Firefox. But Edge and mobile browsers? Not a chance.
- judah 10y agoCan 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 10y agoIn 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.
- Klathmon 10y agoIIRC service workers are shut off after something like 30 seconds of inactivity. So it may work for some cases, but not for all.
- timdorr 10y agoService Workers are specifically designed to be short-lived and temporary [1]. They should be tied to events coming from the main script, which is subject to these new timing limits in the background. You should check your app against Chrome 56, as you might be in for a surprise. [1]: https://www.w3.org/TR/service-workers/#service-worker-lifetime https://www.w3.org/TR/service-workers/#service-worker-lifeti...
- JoeCoder_ 10y agoWhy not have a "this page would like to perform work in the background [allow|block]" notification?
- ryandrake 10y agoI'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 10y ago> 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 10y ago> 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/
- lucb1e 10y agoI 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 10y agoOr 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"
- loco5niner 10y agoI really don't want EVERY website I visit to do this (at least in a pop up).
- windlep 10y agoThe amount of people that will understand what that means is not very substantial. Usually asking for more permissions confuses users as well, people get permission fatigue.
- pmiller2 10y agoThat'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 10y agoThese 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.
- amq 10y agoA setting to only allow this when the machine is on battery would be nice.
- Filligree 10y agoI 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 10y agoAn 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
- vdnkh 10y agoThis 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 10y agoI don't believe it will. From https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/-dmrNAFHd-4/discussion https://groups.google.com/a/chromium.org/forum/#!topic/blink... : Background tabs usually do not have a visible impact for user (tabs with audio are always considered foregrounded).
- croddin 10y agoIs that a workaround/loophole then? A tab can play silent or very quiet audio and then run unthrottled?
- Ambroos 10y agoChrome'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.
- CamelCaseName 10y agoI believe users would quickly find that suspicious as Chrome shows you which tabs are playing sound.
- Spoom 10y agoOne of the first comments on the link above mentions this as a potential exploit; they said they would watch for people attempting it and attempt to mitigate it if it becomes popular.
- CGamesPlay 10y agoSo 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 10y agoNo, 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 10y agoExplain how that is different?
- STRML 10y agoIt'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 10y agoBut 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 10y agoIt 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.
- OskarS 10y ago
- Nirvanachan 10y agoIs this feature enabled on the beta channel of Chrome builds?
- deleted 10y ago[deleted]
- mempko 10y agoThis is their plan. Google will charge companies for extra processing time on your own computer.
- dsr_ 10y agoThis 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 10y agoYep, and Android 6.0 Doze even expanded this mechanism to be more aggressive which proved to provide huge battery savings.
- deleted 10y ago[deleted]
- niftich 10y agoThe 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-dev/XRqy8mIOWps/LvBUbWbxAQAJ https://groups.google.com/a/chromium.org/forum/#!msg/blink-d... [2] https://support.google.com/chrome/answer/1184722?hl=en https://support.google.com/chrome/answer/1184722?hl=en
- haddr 10y agoI'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.
- logicallee 10y agoI 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 a 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 at the same location in the tabs bar that a background tab would have opened.[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 just shit itself after a while because it's stupid and feels the need to open a 99th background tab actively just because I may want to read it in a bit. Come on. Also there needs to be a way (not necessarily the default way) to open private (incognito) windows opened privately "Except for crashes" meaning that it's open until I close it, by clicking the fucking X button, not whenever Chrome decides to barf all over itself (crash) - 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 why not change the 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". Doesn't make much sense does it -- So please make the functionality match what you just promised, and keep pages open until I've closed them. Not you. This stuff would improve people's experiences drastically. It's too bad Chrome's developers don't care about getting Google more clicks, more traffic, letting people open more ads from Google search results, and so forth - by letting people keep more pages and searches open or queued for opening. And that they don't care about their users and give them what they've just promised. Instead, in Incognito windows especially, this stuff just disappears whenever Chrome decides to crash -- which is often, given that it feels like aggressively eating memory for any tab anyone might want to follow. 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. - [1] Functionality. Right-click a link, click "enqueue", this should be the same as "open in background tab" except the tab is added with the URL in it and 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 ones you've already 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 tan to be actually loaded.
- r1ch 10y agoThis 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.
- xg15 10y agoSeems 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-dev/-dmrNAFHd-4/discussion https://groups.google.com/a/chromium.org/forum/#!topic/blink... [2] https://docs.google.com/document/d/1vCUeGfr2xzZ67SFt2yZjNeaIcXGp2Td6KHN7bI02ySo/edit#heading=h.fu3qclnznmk5 https://docs.google.com/document/d/1vCUeGfr2xzZ67SFt2yZjNeaI...
- cabalamat 10y ago> 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)
- tbrock 10y agoThis 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.
- jrockway 10y agoSeems like Edge also plans to do this: https://github.com/WICG/interventions/issues/34 https://github.com/WICG/interventions/issues/34
- gwbas1c 10y agoHonestly, 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.
- altimin 10y agoHi, 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.
- mjburgess 10y agoPinning a tab should disable throttling. Gives user straightforward control over which tabs are important.
- the_watcher 10y agoI second this. I'm generally a fan of efforts to reduce the CPU usage of background tabs (as one who constantly finds himself with an embarrassing number of open tabs), but I need to be able to control which tabs I absolutely don't want throttled.
- ysavir 10y agoNot 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.
- pimlottc 10y agoIncluding me, thanks for the tip! First time I've ever heard of this feature.
- AceyMan 10y ago>Not the greatest solution, considering Pinning isn't documented anywhere and most Chrome users have no idea it exists. -- I might say this is precisely why it'd be smart mode of control: Tying a power user-ish granular feature (throttling) to another power user feature (pinning) seems like a bit of self-selective optimization, while being quite elegant in its simplicity. So, for me, +1 for pinned tabs != throttled.
- dingo_bat 10y agoWhy 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 10y agoI 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 10y ago> 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 10y agoKill 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.
- deleted 10y ago[deleted]
- artursapek 10y agoI 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
- STRML 10y agoYeah - that's a really great trick! You can also get this somewhat "for free" by batching updates on `requestAnimationFrame`, which never fires when unfocused. https://www.npmjs.com/package/visibility https://www.npmjs.com/package/visibility is a nice little package that encapsulates some of the browser compat issues, if you have out-of-date clients.
- artursapek 10y agoBut if you do this, isn't it possible that you'll queue up tons of re-renders that all go off when the tab comes back in focus? I'm thinking of React for example, where you might re-render a component with updated props several times per second. In my case, I've settled on just not re-rendering at all, and then doing so once with the latest props when "visibility" fires again with document.hidden === true.
- STRML 10y agoThis is where batched rendering really comes in handy. For example: https://gist.github.com/STRML/cc368c46c2d7de8679196e69ddbcaef7 https://gist.github.com/STRML/cc368c46c2d7de8679196e69ddbcae... The key is, even in your case (with price alerts), you'll still want to tick occasionally, thus the `FORCE_TICK_INTERVAL`. React's own batching is smart enough to merge the work. For example, before the next tick, one component calls setState() 20 times, another calls it once. Only one rerender will actually be done. Some more discussion on rAF batching here: https://github.com/petehunt/react-raf-batching/issues/8 https://github.com/petehunt/react-raf-batching/issues/8
- nialv7 10y agoThis 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 10y agoFYWD: https://ello.co/dredmorbius/post/ubkidr7yuc7azg9hdnl7lq https://ello.co/dredmorbius/post/ubkidr7yuc7azg9hdnl7lq
- amerine 10y agoGood.
- abalone 10y agoAs 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 10y agoSafari, yes. Chrome no. (You can see it in the task manager)
- om2 10y agoThere 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.
- DaveSchmindel 10y agoSo long to listening to Spotify ad-free at work...
- kbd 10y ago> 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.)
- compuguy 10y agoFor people (like my parents) who open way to many tabs, this will be a big help. Obviously there are a ton of caveats.
- logicallee 10y agoI 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.
- therealmarv 10y agoI 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.
- kruhft 10y agoHow 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.
- jankotek 10y agoI 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 10y agoEven 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.
- steego 10y agoPersonally 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 10y ago> 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.
- steego 10y agoHave you figured out the difference between webpages and apps yet? Let me know when you do and we can continue this discussion. FYI, I switched to iOS because they're much more aggressive controlling about runaway background processes.
- flukus 10y agoThey aren't treated the same because web apps are a lot more resource intensive than their desktop counter parts.
- saurik 10y ago> 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.
- AndyKelley 10y agoThe 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.
- khc 10y agoThere 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
- mzzter 10y agofinally~ But I would prefer if background tabs didn't pre-load at all.
- daveheq 10y ago"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.
- notadoc 10y agoAll browsers should have an option to do this. As long as you can turn it on and off, no big deal.
- codedokode 10y agoThey 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.
- brian-armstrong 10y agoWhat if my page has getUserMedia/microphone access? Do I still get throttled even if I'm not playing any sound?
- dirkg 10y agoWhy 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.
- lstroud 10y agoWhat 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.
- divanvisagie 10y agoLove 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-dev/-dmrNAFHd-4/discussion https://groups.google.com/a/chromium.org/forum/#!topic/blink... 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 10y agoEach 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.
- toodlebunions 10y agoSounds good, would be better if it's adjustable.
- satyajeet23 10y agoSwitched to Safari, happier than ever.
- usernam 10y agoRelated: 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.
- _Codemonkeyism 10y agoYES!
- tarikjn 10y agoI 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.
- richardboegli 10y agoThis 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