I have an idea: why not speed up your site by NOT running js at all?
you are absolutely right. we should completely throw away the development of browser APIs over the years and develop sites with html 4.0
Show HN: Speed up your site by running JavaScript when the browser is idle
31–40 of 95 posts
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#32Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#33Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#34What's the use case? What is "your site" doing that it would need all this computing power?
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#35Earlier quoted context omitted.
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.
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.
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 the browser is idle
#36Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#37I have an idea: why not speed up your site by NOT running js at all?
you are absolutely right. we should completely throw away the development of browser APIs over the years and develop sites with html 4.0
At least in the old days if CSS or JS didn't load, you still got a semi-usable page.
Turning HTML+CSS+JS into an application platform has been one of the most fundamentally stupid things we've done as a field and we'll keep paying for it for years on end, second only to not adding slices to C.
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#38This is not used for malicious CPU hijacking or whatever. It's a way to schedule low-priority JS tasks for later when the main thread is unblocked and give priority to more important things. It's a very useful API for when optimizing games or complex web applications.
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#39What's the use case? What is "your site" doing that it would need all this computing power?
What kind of question is that? Games or applications like Figma obviously require more computing power than a static homepage.
Those are interactive applications, there's not that much work for them to do when you're not interacting with them.
Re: Show HN: Speed up your site by running JavaScript when the browser is idle
#40Earlier quoted context omitted.
What kind of question is that? Games or applications like Figma obviously require more computing power than a static homepage.
Do they? To do what when the computer is idle ? Those are interactive applications, there's not that much work for them to do when you're not interacting with them.