Re:Show HN: Speed up your site by running JavaScript when th...
by nottorp on Thursday November 24, 2022 @09:53AM
(#33731936)
You mean my browser still doesn't use enough CPU? I don't want sites that aren't in focus to do anything.
[ Parent
| on HN ]
Re:Show HN: Speed up your site by running JavaScript when th...
by matsemann on Thursday November 24, 2022 @10:04AM
(#33732065)
The point is to play nice. "I have this task the page needs to do, but I can wait a bit until more convenient". Not "browser is idle, let's mine some bitcoin" as you suggest.
Re:Show HN: Speed up your site by running JavaScript when th...
by nottorp on Thursday November 24, 2022 @10:12AM
(#33732165)
Actually I wasn't thinking of bitcoin, but for example of needless auto refreshes and animations.
Seriously, web devs need to learn to respect my battery and electricity bill more.
Re:Show HN: Speed up your site by running JavaScript when th...
by Kiro on Thursday November 24, 2022 @10:53AM
(#33732710)
This does not do what you think it does. You're tilting at windmills.
It's not about doing stuff in a tab that isn't in focus. "Idle" refers to the main thread idling in the page you're currently using, so it's about controlling the execution order and priority of JS tasks. E.g. on Google Maps you give priority to rendering the visible map tiles while deferring preloading the surrounding non-visible tiles until the main thread is unblocked (and thus idling).
Re:Show HN: Speed up your site by running JavaScript when th...
by neweroldguy on Thursday November 24, 2022 @05:43PM
(#33737071)
This is just a generic “old man shouting at clouds” complaint at this point. You’re not engaging with the material at all.
Re:Show HN: Speed up your site by running JavaScript when th...
by ovao on Thursday November 24, 2022 @11:18AM
(#33733035)
The requestIdleCallback API isn’t specific to inactive tabs, and trying to use it to do background work in general is not a Good Idea: the first idle callback is typically going to fire (almost) immediately after painting’s complete, or some handful of milliseconds after.
Re:Show HN: Speed up your site by running JavaScript when th...
by MichaelCollins on Thursday November 24, 2022 @03:26PM
(#33735836)
Every web dev seems to think that their site specifically is the reason everybody in the world bought a computer.