Re:Tab throttling and more performance improvements in Chrom...
by Aardwolf on Tuesday November 17, 2020 @04:31PM
(#25130148)
It can be an issue if the game can do complex actions at any time: if you then need to do all of it in one gigantic update after e.g. 24 hours of being in the background, it may take too long to compute that one long tick. Depending on what type of game it is. If it just has to compute "so many resources per second produced" it's easy of course and you can use the delta between last tick (if Date.now() works correctly), but if the game can auto-build various things with complex interactions, it can become computationally complex if it has to do all at once.
Re:Tab throttling and more performance improvements in Chrom...
by chhamilton on Wednesday November 18, 2020 @09:56AM
(#25137412)
(Chromium dev here.)
Doing the work in one giant update is actually better from a power consumption / battery point-of-view, because the CPU cost is fixed but there are fewer wakeups overall.
Note that the new throttling logic means you get woken-up once per minute; we're not talking about preventing your page from doing work for a 24 hour period.
For full details of how the throttling works, see here:
Re:Tab throttling and more performance improvements in Chrom...
by intellix on Tuesday November 17, 2020 @08:09PM
(#25132019)
It sounds like the tab throttling is working as intended then. If I've moved from your game and haven't looked at it then why shouldn't all of that extra computation happen until the next time I'm interested?
Re:Tab throttling and more performance improvements in Chrom...
by bobbylarrybobby on Tuesday November 17, 2020 @08:15PM
(#25132056)
For idle games, much of the point is investing in auto-building, then coming back to the game when your investment has borne fruit. For this to work, it has to be able to run in the background.
Re:Tab throttling and more performance improvements in Chrom...
by CyberDildonics on Wednesday November 18, 2020 @10:46AM
(#25138051)
There is a big difference between throttling and not running. Still, it is probably much better to sync with the server than run something at full blast to increment some counters.
Re:Tab throttling and more performance improvements in Chrom...
by iofiiiiiiiii on Thursday November 19, 2020 @04:06AM
(#25147610)
Sounds like it's time for the game authors to provide some servers with the compute resources to do this background processing.
Re:Tab throttling and more performance improvements in Chrom...
by nextaccountic on Wednesday November 18, 2020 @01:05AM
(#25133681)
But if it lies about Date.now() this isn't possible..
Re:Tab throttling and more performance improvements in Chrom...
by CyberDildonics on Wednesday November 18, 2020 @10:37AM
(#25137919)
That would be broken and isn't what is being talked about here. There is no reason scheduling as a low priority would mean you need to lie about the current time.
This is a very basic issues with doing stuff on a timer, and not that hard to do properly. It shouldn't make a difference if your timer is called once per second, once per minute or once in 10 hours in the background, you always calculate based on the delta to the last time your timer fired.