Live data from Hacker News

Chrome will aggressively throttle background tabs

blog.strml.net

81–90 of 403 posts

Re: Chrome will aggressively throttle background tabs

#81
post #71

Earlier quoted context omitted.

It is. But then you open it in multiple tabs, because that's how people use websites. Unless I'm supposed to re-implement tabs within my single page application and then force it to only let one tab run, which I guess is possible but horrible :)

If it opens in multiple tabs, then it isn't a pure SPA. (Relying on the browser tabs instead of tabs in your application.) If you have several tabbed views, then you would include tabs in your application.

It is a pure SPA, you just have the option of opening multiple instances at the same time. Like I can open gmail in two tabs, but it's still an SPA.

And yeah tabs in JS are possible and I might go down that route, it'll just be a lot of extra work to replicate a UI that already exists fine.

Re: Chrome will aggressively throttle background tabs

#82

Earlier quoted context omitted.

Could you create a tabbed interface that is just a dumb view of a server state communicated over websockets? Then the user could just open the page in n windows (each on its own tab) and have the same state represented in each?

Problem is, there is no server. All client side. So the tab on which you click "run simulation" is effectively the "server", except it stops running when the user switches tabs.

Put two of them in two iframes on the same page? No code changes should be needed

Re: Chrome will aggressively throttle background tabs

#83

Earlier quoted context omitted.

It probably doesn't. Measuring memory usage is hard on a modern OS. I'd guess there's a lot of shared memory between tabs

If 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.

You'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.

Re: Chrome will aggressively throttle background tabs

#84
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.

Re: Chrome will aggressively throttle background tabs

#85
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... [2] https://support.google.com/chrome/answer/1184722?hl=en

Re: Chrome will aggressively throttle background tabs

#86
post #23

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

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.

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

Re: Chrome will aggressively throttle background tabs

#87

Earlier quoted context omitted.

Problem is, there is no server. All client side. So the tab on which you click "run simulation" is effectively the "server", except it stops running when the user switches tabs.

Put two of them in two iframes on the same page? No code changes should be needed

[deleted]

Re: Chrome will aggressively throttle background tabs

#88
post #71

Earlier quoted context omitted.

If it opens in multiple tabs, then it isn't a pure SPA. (Relying on the browser tabs instead of tabs in your application.) If you have several tabbed views, then you would include tabs in your application.

It is a pure SPA, you just have the option of opening multiple instances at the same time. Like I can open gmail in two tabs, but it's still an SPA. And yeah tabs in JS are possible and I might go down that route, it'll just be a lot of extra work to replicate a UI that already exists fine.

Here's an example: http://orteil.dashnet.org/cookieclicker/

Opening another tab creates a new bakery, not a view into the same bakery. (This only works if you haven't played before or clear your cookies.)

Edit:

If you really want to keep the same functionality then you would need to bring server communication into the mix. It's possible to either run the simulation server-side, or at least communicate the state between tabs using a server.

If you send an email in one Gmail window and it shows up in the other window, then I would guess it receives a message from the server to update.

Re: Chrome will aggressively throttle background tabs

#89
post #77

Earlier quoted context omitted.

> 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…

> 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/

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.

Re: Chrome will aggressively throttle background tabs

#90
post #54

Earlier quoted context omitted.

Defining it is what's hard. how much memory is each process using? 20MB. Oh but they are sharing the pages the executable is mapped into. So how can you can you say they are each using that much RAM? Because that 10MB of RAM won't be freed until the last process exits. Each process is using 20MB of physical pages. If only 1 was running it would use 20MB. The semantics that each process is sharing 5 HUGEPAGES of heap…

Sure, shared/unshared semantics are not hard. How do you map that to a generic concept of "usage"? There's no right way to do it. It doesn't really make sense to ask "how much memory is this process using?" Instead, you want to ask questions like "how much memory are all of these processes using?" or "how much memory would be freed if I terminate these processes?" or "how much extra memory will be used if I start ano…

     There's no right way to do it.
     What's hard is understanding which question you want to 
     ask in any given situation.
I don't see the issue. You admit that answering all of these questions is easy. The hard part is lawyering which question to ask.

This is not a data reporting problem.

This is a data interpretation problem.

A good reporting tool should not be interpreting (or forcing an opinion) on the end user.

You believe this problem is hard because you are forcing an interpretation to exist before you take a measurement. When you should not be interpreting until after measurement. Injecting an interpretation into a measurement process fundamentally changes that measurement.

Measurements inform your interpretation. Not the opposite.

TL;DR You put the cart in front of the horse.

Post reply on HN