Live data from Hacker News

Show HN: Speed up your site by running JavaScript when the browser is idle

npmjs.com

91–95 of 95 posts

Re: Show HN: Speed up your site by running JavaScript when the browser is idle

#91

Or... use a web worker

Webworkers run on their own thread. The point of this is to run low-priority tasks without impacting the main loop, and without the complexity of separate threads.

If the task is a long running expensive task, it's going to block the main thread from being responsive to user input. If it's a quick task then you don't need to schedule it. I struggle to see the place for a medium length task which is long enough that it needs to be deferred but short enough that it can't be executed immediately.

What would be an example?

Re: Show HN: Speed up your site by running JavaScript when the browser is idle

#92

Earlier quoted context omitted.

Webworkers run on their own thread. The point of this is to run low-priority tasks without impacting the main loop, and without the complexity of separate threads.

If the task is a long running expensive task, it's going to block the main thread from being responsive to user input. If it's a quick task then you don't need to schedule it. I struggle to see the place for a medium length task which is long enough that it needs to be deferred but short enough that it can't be executed immediately. What would be an example?

Sending telemetry data.

It’s low priority, and perhaps it’s quick, but there is no reason it can’t when idle.

Re: Show HN: Speed up your site by running JavaScript when the browser is idle

#93
post #90
post #87

Earlier quoted context omitted.

It's not a matter of agreement, it's just that this sort of comment is offtopic in Show HN's.

> When something isn't good, you needn't pretend that it is, from the link you provided…

That's right, except you skipped all the other bits in the link provided -

Be respectful. Anyone sharing work is making a contribution, however modest.

Ask questions out of curiosity. Don't cross-examine.

Instead of "you're doing it wrong", suggest alternatives. When someone is learning, help them learn more.

When something isn't good, you needn't pretend that it is, but don't be gratuitously negative.

Reflexive snark comment that's not even about the thing being shown is none of that. And there's also

Please don't post shallow dismissals, especially of other people's work.

from

https://news.ycombinator.com/newsguidelines.html

Re: Show HN: Speed up your site by running JavaScript when the browser is idle

#94

This whole thing is about performance, but what I'm not seeing any of is actual measurements. Is this actually useful enough to justify all the overhead of writing code in a catered way? Right now I highly doubt it. Is this beneficial at all? After all you're adding some extra overhead and delays which might or might not be made up for by the fact that things are chopped up. The whole of the work doesn't change, you'…

I agree with you. It is difficult to measure how to improve the site performance concretely by using idle-task, but I will do this with my application.

Re: Show HN: Speed up your site by running JavaScript when the browser is idle

#95
post #93
post #90

Earlier quoted context omitted.

> When something isn't good, you needn't pretend that it is, from the link you provided…

That's right, except you skipped all the other bits in the link provided - Be respectful. Anyone sharing work is making a contribution, however modest. Ask questions out of curiosity. Don't cross-examine. Instead of "you're doing it wrong", suggest alternatives. When someone is learning, help them learn more. When something isn't good, you needn't pretend that it is, but don't be gratuitously negative. Reflexive snar…

I did suggest an alternative: not running js.

You clearly don't like my idea, but that doesn't mean it isn't valid.

Post reply on HN