Chrome To Introduce Timer To Throttle Background Pages (ghacks.net) 122
Google plans to roll out a change in Chrome Stable soon that will have the browser throttle timers in background tabs to improve battery life and browsing performance. From a report: The motivation behind the chance is that some pages consume a lot of CPU when they are in the background. Google mentions JavaScript advertisements and analytics scripts explicitly but it is not limited to that. The core idea is to limit the processing power that background tabs get in Chrome once the feature lands. (1) Each WebView has a budget (in seconds) for running timers in background. (2) A timer task is only allowed to run when the budget is non-negative. (3) After a timer has executed, its run time is subtracted from the budget. (4) The budget regenerates with time (at rate of 0.01 seconds per second). (5) The only pages that appear to be exempt from the throttling are those that play audio.
Easy (Score:3)
I guess we'll be seeing a lot more pages that play audio soon.
Re: (Score:2)
Indeed.
Why not have a checkbox on every tab that defaults to off, and which dictates whether the page updates at all when the tab is inactive?
Almost all tab use is, unfortunately, a lazy substitute for bookmarking, of pages that don't need to update when not viewed.
Two tab uses that aren't bookmark substitutes (Score:3, Insightful)
Almost all tab use is, unfortunately, a lazy substitute for bookmarking, of pages that don't need to update when not viewed.
Key words: "Almost all". I can think of a couple exceptions that aren't "a lazy substitute for bookmarking":
Re: (Score:2)
Key words: "Almost all". I can think of a couple exceptions that aren't "a lazy substitute for bookmarking":
And that's where it would come in handy to have a checkbox, which would allow javascript and refreshes for that URL even when in the background. It would be a one-time switch flip for the sites where it's needed.
Re: (Score:2)
The Great Suspender?
Isn't that the extension for supporting content that is pants...
Re: (Score:3)
Tabs are like the piles of papers on your desk. Someone may point to the desk and claim it is inefficient, just file everything into properly labeled folders and put them away when you are done. But in reality it doesn't happen. You're working on one thing and then someone walks by and drops another project on your desk, asks you a question that you have to research before the person leaves, or you get an email that says "please finish filling out form XYZ by the end of the day". After a few iterations
Re: (Score:1)
"Almost all tab use is, unfortunately, a lazy substitute for bookmarking, of pages that don't need to update when not viewed."
Speak for yourself. Code reviews - one tab per file, close each tab as the file is reviewed = more efficient. Evaluating product pricing across shop sites - more efficient to keep each shop in a tab and flip between them. Research - each link in a wikipedia page can be opened in a tab and read in sequence.
Re: (Score:2)
Speak for yourself. Code reviews - one tab per file, close each tab as the file is reviewed = more efficient. Evaluating product pricing across shop sites - more efficient to keep each shop in a tab and flip between them. Research - each link in a wikipedia page can be opened in a tab and read in sequence.
None of those scenarios seem to me to require background updates of the pages after they have been rendered once?
Re: (Score:1)
Indeed.
Why not have a checkbox on every tab that defaults to off, and which dictates whether the page updates at all when the tab is inactive?
Almost all tab use is, unfortunately, a lazy substitute for bookmarking, of pages that don't need to update when not viewed.
No.
Bookmarks do not (and are not meant to) keep track of what I'm doing on a page. If I read half an article, switch tabs, then switch back, I'm right at the same place I left off. If I had to log into a site, I'm still logged in. If I've typed in part of a reply or comment on a site like slashdot, what I've typed is still there.
Bookmarks do not preserve the state of the page. That's not what they're for.
Put another way, tabs are primarily just a replacement for having multiple individual browser windows op
Re: (Score:2)
Indeed.
Why not have a checkbox on every tab that defaults to off, and which dictates whether the page updates at all when the tab is inactive? Almost all tab use is, unfortunately, a lazy substitute for bookmarking, of pages that don't need to update when not viewed.
You're an idiot to assume that your use case is also everyone else's use case. Or just an arrogant ass. Or both.
I use multiple tabs when doing Internet searches. I always right-click links and select Open Link in New Tab. That way, I can close an irrelevant new tab without losing track of my search, and without having to backtrack to the correct page in the history. I can also leave a slow-loading new tab alone while I look at another tab. Or even right-click > Open on 2 or 3 links in a row so they ca
Re: (Score:1)
You're an idiot to assume that your use case is also everyone else's use case. Or just an arrogant ass. Or both.
Pot, meet kettle.
I use multiple tabs when doing Internet searches. I always right-click links and select Open Link in New Tab.
So do I. As someone recently said, "you're an idiot to assume".
How would that use case be negatively affected by preventing javascripts and reloads? Unless you use a search engine that redirects all your windows to their page so they can track your search results, I don't see a negative effect if the background pages stop updating after the initial rendering for as long as they stay in the background.
And even then, all that is needed is a timer. Stop updating after having been in the b
Re: (Score:2)
They are simply taking issue with your assertion that tabs are a substitute for bookmarks. They emphatically are not, and no reasonable person could take that position.
I explicitly added a qualifier so I would not come across as saying they always are. Do I have to add <BLINK> tags?
Of course there are other uses. I never said otherwise.
But when someone has a huge number of tabs open, and don't look at most of them, yes, they are used as bookmark substitutes. Walk around your office. Watch how prevalent this is.
Re: (Score:2)
They are simply taking issue with your assertion that tabs are a substitute for bookmarks. They emphatically are not, and no reasonable person could take that position.
I explicitly added a qualifier so I would not come across as saying they always are. Do I have to add <BLINK> tags?
Of course there are other uses. I never said otherwise.
But when someone has a huge number of tabs open, and don't look at most of them, yes, they are used as bookmark substitutes. Walk around your office. Watch how prevalent this is.
I use them more as disposable pages. Stuff that I might get to if an early page doesn't answer a question or a page I might want to read but don't care enough to bookmark it.
Re: (Score:1)
Nah, almost all tab use is a necessary work around to the overall shitty design of websites. The core problem being that page navigation is _slow_ especially with advert, analytics, shitty JS frameworks and otherwise junk ridden modern websites. If you go to a site, such as a news site, and want to visit multiple sub pages the best way to avoid this slowness is to open the links in the tabs and let them load "in parallel" vs navigating to one, then navigating back to the main page, then navigating to the ne
Re: (Score:2)
I am not sure there really is a point trying to circumvent this limitation.
There is no point in showing ads and monitoring background pages, and developers probably don't mind being throttled in this case. In fact, they probably want this behavior but are too lazy to check whether or not the page is actually visible before running their scripts at full speed.
Re: (Score:2)
I guess we'll be seeing a lot more pages that play audio soon.
Why? What's the point? There's no benefit to chewing up the end user's CPU for an ad they aren't actively watching.
Advertising companies are stupid for the most part, not malicious. Web designers also are stupid for not testing things like CPU load on their scripts. There's no point in circumventing the restriction unless you're mining bitcoins in a tab, in which case the user likely has bigger problems.
Re: (Score:3)
So now we need adblockers that detect pages that detect adblockers.
Some already do. But this may violate anti-circumvention law [blockadblock.com], be it a country's WIPO Copyright Treaty implementation (such as the Digital Millennium Copyright Act) or laws defining trespass upon a networked computer (such as the Computer Fraud and Abuse Act).
But if website operators try to assert the DMCA or CFAA against ad blocker developers, the latter will probably end up building plausible deniability into their products. Instead of blocking ads per se, they'll block third-party tracking (such as Discon
Re: (Score:2)
Slashdot is a U.S.-based site, and the U.S. is not the only party to the WIPO Copyright Treaty.
Re: (Score:1)
That is what Greasemonkey/Tampermonkey are for, as an addition to uBlock Origin. They help somewhat, but some sites still skitter around them. Definitely an arms race going on.
Make the speaker icon blink (Score:5, Interesting)
Silent audio won't necessarily work, as browsers are already detecting whether a video's audio is silent. In Firefox 51, this video that has intermittent audio [pineight.com] causes the speaker icon in the tab to blink on and off whenever the game plays a sound effect.
Re: (Score:3)
Re: (Score:2)
Silent audio won't necessarily work, as browsers are already detecting whether a video's audio is silent. In Firefox 51, this video that has intermittent audio [pineight.com] causes the speaker icon in the tab to blink on and off whenever the game plays a sound effect.
Easy solution, the audio file will be a constant tone at 100 kHz. The user wouldn't notice it since it is well outside human hearing range, and the sound is playing 100% of the time.
Re: (Score:2)
Google Chrome only supports up to 48KHz audio. Good luck encoding a 100KHz tone with less than a 200KHz sample rate [wikipedia.org].
Re: (Score:2)
No need to even get fancy with frequencies. You could play a 100Hz tone at very low amplitude and nobody would notice unless they saw the speaker icon on the tab.
Re: (Score:2)
20k is easy to hear for young people. Try 40k.
Note to Google Chrome team: Re: Audio (Score:2)
It is always wrong (ok, 99.9% of the time wrong) to have more than one context/page/plug-in instance in the browser play audio at a time, whether the context is backgrounded or not.
From a user perspective, the result of multiple concurrent audio streams is garbled, unintelligible, dissonant sound.
So if you can save power by preventing that, do so.
Related case in point: When a browser re-starts after a crash, it often seems to start auto-playing a bunch of separate youtube videos (which had been paused or at
Re: (Score:2)
It is always wrong (ok, 99.9% of the time wrong) to have more than one context/page/plug-in instance in the browser play audio at a time, whether the context is backgrounded or not.
Are you sure about that? I count on my mail tab to ding when I get mail, my voice tab to ring when a call is incoming, and my friendster tab should ding when someone posts to my page.
Re: (Score:2)
ok, good points. Perhaps short little audios like that are ok.
Bult multiple videos with audio playing in background tabs? That should be something you have to explicitly enable as a user. Not the default.
Or at the VERY least, you should have the option to set your browser up as doing pause-on-background as its behaviour default.
Re: (Score:2)
Also, I should say: Fine, as long as you don't work in an open plan office, or always use a headset.
Otherwise, your office mates will think you are a "ding"bat.
Dings 0.1% of the time (Score:2)
It is always wrong (ok, 99.9% of the time wrong) to have more than one context/page/plug-in instance in the browser play audio at a time
Are you sure about that? I count on my mail tab to ding when I get mail, my voice tab to ring when a call is incoming
If you get more than an average of 3.6 seconds of notification sounds per hour, then "99.9% of the time" they're not being played.
Re: (Score:2)
Reading other comments on this article it appears many people like to listen to lots of surprising stuff in background tabs.
Re: (Score:2)
Minor correction: There needs to be less than 3.6 seconds of notification audio per hour.
Re: (Score:1)
Nope... they will just sell audio ad space to all comers.
It's usually more efficient to run at full speed (Score:1)
There are two types of processing jobs: One is a fixed amount of work, the other is as much work as can be done. You only save battery power by throttling the latter. The fixed amount of work type of job is usually more efficiently executed at full speed. So this may backfire. And who believes this isn't Google throttling competitors' analytics scripts while not throttling their own?
Re: (Score:3)
The problem is documents that run "as much work as can be done"-type tasks that don't benefit the user, such as sending a client-side real-time-bidding ad auction out to forty different ad networks. So perhaps the goal is to discourage documents from running "as much work as can be done"-type tasks at all without the user's consent.
Will Google customers get preference? (Score:2)
Coming soon - audio everywhere! (Score:1)
Great, now ever page with an advertisement on it will play some audio in order to get around the timers.
Re: (Score:2)
Re: (Score:2)
Until every page does it and you have to interrupt your flow in order to move your mouse up and click the tiny icon after every single tab load. Plus the wasted bandwidth downloading a bunch of audio that you don't want and are just going to disable immediately anyway.
And then add on the fact that unless all browsers implement similar features, anyone who uses not-Chrome will be at even more of a disadvantage.
I don't know what the solution here is. They obviously don't want to prevent people who listen to
Stop those css popups (Score:5, Interesting)
Can they stop those css pop up screens? You know the kind that darken your background and ask for your email address when browsing many sites? You are forced to try and look for the nearly invisible X to close them. Tons of mainstream sites do this and its annoying as hell.
^W stops css popups (Score:5, Insightful)
To block sponsor and mailing list pop-overs, just press Ctrl+W [tabcloseddidntread.com] (Command-W on macOS).
Re: (Score:2)
Re:Stop those css popups (Score:5, Informative)
Right-click, inspect element. Look down. Right click, delete element. Done.
Apple Called... (Score:1)
And although I can't seem to find any web pages on it, Safari also pauses Tabs that are "in the background", too.
Re: (Score:2, Informative)
Safari purges tabs in the background all the time saving enormous amounts of processing, yet it reloads them far too frequently as well wasting even more.
Re: (Score:2)
Re: (Score:2)
The browser is re-inventing preemptive scheduling algorithms.
Which isn't necessarily a bad thing. Not all web applications would work better as native applications, especially because most users don't want every web app to become (say) Mac-exclusive.
Re: (Score:2)
This is common sense. If the page is not visible, then it should NOT do anything. If it's still hogging the cpu when I can't see it then that is lazy ass programming by a wannabe coder. The timer solution idea has been used in many applications and systems in the past, though not exactly the same way. It's hardly a new groundbreaking concept, it's quite like dynamic priorities in unix systems. Better to use have the headline read "Chrome throttles cpu usage of background tabs, but still is unable to co
Re: (Score:2)
This is common sense. If the page is not visible, then it should NOT do anything. If it's still hogging the cpu when I can't see it then that is lazy ass programming by a wannabe coder. The timer solution idea has been used in many applications and systems in the past, though not exactly the same way. It's hardly a new groundbreaking concept, it's quite like dynamic priorities in unix systems. Better to use have the headline read "Chrome throttles cpu usage of background tabs, but still is unable to completely stop them for fear of angering the advertising overlords."
LOL!
audio (Score:2)
The only pages that appear to be exempt from the throttling are those that play audio.
So pages that steal computing cycles will start playing inaudible sounds while they work. This will stop all the scripts except for those that really should be stopped, and annoy pet dogs around the world too.
And Chrome makes itself suck even *more* for games (Score:2)
I wouldn't care quite so much if Mozilla didn't appear dead set on committing suicide, but at this rate, I'll be running Edge by the end of the year!
Re: (Score:2)
Re: (Score:2)
Two obvious situations come to mind. First, "Idle" games, where you basically just let it run in the background and check in on it once an hour. And second - Let's say I want to look something up (maybe a Wiki for the game itself) in another tab; online games typically do not react gracefully to losing their network connection, and I would be shocked if being throttled for more than 100-250ms per second wouldn't have almost the same effect.
Re: (Score:2)
when do you think it's useful to run games in background tabs?
When they're streamlined simulations of an RTS's tech tree. Click the cookie a few times [dashnet.org] and I'll explain.
so... (Score:1)
does that mean I can keep 500 tabs open, instead of 50?
Hear the silence (Score:2)
According to the article (yes, I RTFA), here's the criteria:
-Each WebView has a budget (in seconds) for running timers in background.
- A timer task is only allowed to run when the budget is non-negative.
- After a timer has executed, its run time is subtracted from the budget.
- The budget regenerates with time (at rate of 0.01 seconds per second).
This suggests a few ways around this.
- Play a 0.1 second silent audio sample on page load, throwing the page into "non-throttle mode".
- If "playing audio" i
Re: (Score:1)
The easiest way would be a checkbox to turn off all audio, and not have audio sites have an exception. Even better, a checkbox with a whitelist, so the few sites I want to listen to (i.e. YouTube) are OK, but everything else gets muted.
Wow, what a loophole! (Score:2)
The only pages that appear to be exempt from the throttling are those that play audio.
So every page is now going to play a silent audio track in a loop in order to work around this limitation?
This is a common trick in iOS applications to prevent the system from backgrounding you when off-screen. It won't take long to migrate to the web . . .
Why is it so hard (Score:2)
to have a mainstream browser just be a browser?
I'm going to sound like an old man but there was a time when all Chrome was aiming for was to be fast and lean. And it was able to be that. Something changed and now Google wants to use it for more than that. Which is when these sorts of things always go to shit. We saw it with IE, which was always shit but it got even more shit to everyone's surprise. Firefox keeps going through cycles of shittiness. Ug.
Re: (Score:1)
Something changed and now Google wants to use it for more than that.
1) Make a product that does something better than the competition
2) Push your product to be bundled with everything
3) When you have almost monopoly, do what the fuck you want
Reminds you of something?
Re: (Score:1)
Browsers have pretty much replaced operating systems these days, so a browser has to have all the security features an OS does, because they execute untrusted code 24/7. Eventually OS makers will get smart, add tier 1 hypervisors, and have the browser be on its own VM with a separate memory and filesystem space, so a compromised browser doesn't hose the user.
Re: (Score:2)
Microsoft [arstechnica.com] has already started doing this with Edge. Mind you they are only doing it on the Enterprise version of Windows, but I could definitely see this happening on the consumer versions in the near future. It definitely makes sense considering all the stuff the browser is doing to make sure that it doesn't interfere with the security of the system.
"throttle" to ZERO (Score:3)
Egads, what took so long? This should have been done YEARS ago.
But tabs I am not looking at, (by default) should use ZERO CPU. I get that I might launch several tabs quickly and want to allow them to load. So, allow some time for them to load, but then cut it to zero.
Give me the OPTION to change this behavior. Give me the OPTION to play music in background (either globally, or on a specific tab). And for gosh sake, SHOW ME how much CPU each tab is using (optionally). Then I will know to avoid the sites that are using my browser to bitcoin-mine.
Apple had to clamp down on iOS apps that were abusing the "background audio" flag. Too many apps just played silent audio. Now, playing silent audio will get the app bounced from the store.
Unfortunately, the web has no benevolent dictator vetting sites. OF COURSE "background audio" will be abused!
Re: (Score:2)
But tabs I am not looking at, (by default) should use ZERO CPU. I get that I might launch several tabs quickly and want to allow them to load. So, allow some time for them to load, but then cut it to zero.
Give me the OPTION to change this behavior. Give me the OPTION to play music in background (either globally, or on a specific tab). And for gosh sake, SHOW ME how much CPU each tab is using (optionally). Then I will know to avoid the sites that are using my browser to bitcoin-mine.
This! I was reading this discussion to find out whether I need to post myself. You did it for me. Thanks :)
No freaking way should background tabs run scripts by default.
Re:"throttle" to ZERO (Score:4, Informative)
If you're using Chrome, check out an addon call The Great Suspender (maybe it exists in FF too, I haven't checked.) Its been a lifesaver for a tab hoarder like me.
too much detail (Score:2)
The idea is to limit the processing power that background tabs get.
Got it. Simple, succinct, perfect.
(1) Each WebView has a budget (in seconds) for running timers in background. (2) A timer task is only allowed to run when the budget is non-negative. (3) After a timer has executed, its run time is subtracted from the budget. (4) The budget regenerates with time (at rate of 0.01 seconds per second).
Of what interest is it to anybody that the pseudo-code for this is the above, vs some other slightly different variant of how to restrict allocated processing time? Users aren't going to care. And if developers try to somehow design around this level of detail, they'll break if the algorithm ever changes.
When I tell a friend I'll show up for dinner, I don't then explain that I'm going to do so by walking one foot at a time until I get to the dinner place, at which poi
noisy pages loading :-( (Score:2)
The only pages that appear to be exempt from the throttling are those that play audio.
Dadgummnit! Those noisy ads that auto-play while I'm pre-loading news articles are the ones I want suppressed.
When I spawn a tab to pre-load a (quiet) article, I want it to load ASAP, not throttled.
Re: (Score:2)
Presumably, the throttling would a) not apply until the page is actually loaded and b) have enough initial budget that the vast majority of pages wouldn't notice for at least several seconds after the initial load is complete.
I mean if you've got a webpage that manages to full bore your CPU for 10+ seconds as soon as it loads.. the page designer probably should be doing something different, throttled or not.
Sounds like it's only useful for laptops (Score:2)
Wrong model... Should work like Fine Location (Score:2)
Tying this to audio only is a bad UI design. Otherwise we are going to be seeing a lot more audio applications.
This should not be arbitrarily set by Google. Instead, it should come up as a permissions pop-up like the location permissions...
For example, it could say... This application wishes to update in the background more frequently than the recommended levels. This may affect battery life. Do you approve" [Yes] [No]
How does this affect work tabs? (Score:2)
I have several tabs open all day long in the background for time tracking.
They use setInterval for autosaving. As this is semi-important, I wouldn't want this tab to be throttled.
Will there be an easy to use UI for disabling this throttle on a per tab basis? Perhaps in the context menu?
Re: (Score:2)
Do those tabs consistently use more than 1% CPU each? Cause if they don't, the throttling will likely have little or no effect on them.
This is to stop stupid things like ad carousels that rotate every 5 seconds whether you're looking at them or not. Or just flat out poorly-programmed JS that sucks up all available CPU just because the developer couldn't be bothered with something more complex than busy loops and other dumb stuff like that.
There will probably be the odd legitimate app that gets negatively
Motivation? (Score:1)
Okay, but what does luck have to do with it?
A web page should do nothing when I'm not looking (Score:2)
No web page should do anything when you're not looking at it. Full stop. Pun intended.
Weren't timers originally disabled? (Score:3)
Google you idi9ts (Score:2)
1. Skip "CPU Budget" stuff
Just have a throttle of 10 or 100 or 1000 script actions per second, set well below browser lockup speed. To hell with reviews your browser is 0.028% slower than IE or Edge or Opera, running balls out locked up.
ATTN REVIEWERS OF BROWSERS: When you review for script speed, not caring about lockup, you are full of fail. This is all your fault.
2. I don't care what standard allows popups -- get rid of them.
3. I don't care what standard allows message boxes -- get rid of them.
4. I do
Foreground too, and all browsers, PLEASE (Score:2)
>"Google plans to roll out a change in Chrome Stable soon that will have the browser throttle timers in background tabs to improve battery life and browsing performance."
It also kills remote access and thin clients. I have been screaming about this for years. And it shouldn't just be for background tabs, it should be for foreground ones too... if you are idle or the window doesn't have focus, there should be a way to throttle the hell out of the thing! Timers, animation, mouse polling, useless refresh
Re: (Score:2)
Reply to cancel accidental down mod. Very sorry.