Live data from Hacker News

The browser's main thread is expensive

kciter.so

11–20 of 168 posts

Re: The browser's main thread is expensive

#13
post #12

I wish await in JavaScript could conditionally yield. Instead I end up having to use arounds like if (shouldYield()) await do yield();

There's an RFC or two to spawn threads so I'm looking forward to that. The current way of workers + messages is tedious as hell.

Re: The browser's main thread is expensive

#15
post #7

Yeah, but if your website with, you know, text and stuff, doesn't do any stupid and unnecessary crap, it doesn't matter where the nonexistent unnecessary yet expensive code doesn't run.

Sure, but there are sites like HN and there are sites like https://earth.nullschool.net/ What's your point? Are you saying all animations and rendering are unnecessary?

My point is that many websites are using way too much technology for what they need to do, with correspondingly long load times and choppy runtime behavior.

Re: The browser's main thread is expensive

#16
post #8

Yeah, but if your website with, you know, text and stuff, doesn't do any stupid and unnecessary crap, it doesn't matter where the nonexistent unnecessary yet expensive code doesn't run.

Well yeah but if you do actually need things like images, animations, high frequency updates, etc, this is actually a pretty good overview of how to approach it. Also learned that react uses posting to a MessageChannel to yield!

GP is right that just like with garbage where "reduce, reuse, recycle" is the mantra, the first question for optimizing something should be if you need to do the calculation at all.

Re: The browser's main thread is expensive

#17

Yeah, but if your website with, you know, text and stuff, doesn't do any stupid and unnecessary crap, it doesn't matter where the nonexistent unnecessary yet expensive code doesn't run.

Amazing how you are being so down voted, most webpages do utter crap that no one would want the webpages to be doing other then advertisers. Really most things should be text and if we lived in a more cooperative world everything would be easy to parse and manipulate text with some video and images and perhaps various well defined interface types for different services that can be implemented in various ways as to the users liking.

Re: The browser's main thread is expensive

#18
post #8

Earlier quoted context omitted.

Well yeah but if you do actually need things like images, animations, high frequency updates, etc, this is actually a pretty good overview of how to approach it. Also learned that react uses posting to a MessageChannel to yield!

GP is right that just like with garbage where "reduce, reuse, recycle" is the mantra, the first question for optimizing something should be if you need to do the calculation at all.

This is true as well, yeah, but it came off as dismissive of everything too. Personally I prefer information dense interfaces with minimal chrome, but there really is a certain joy when you get to use a well designed and optimized fancy reactive, immersive interface

Re: The browser's main thread is expensive

#19
post #7

Earlier quoted context omitted.

Sure, but there are sites like HN and there are sites like https://earth.nullschool.net/ What's your point? Are you saying all animations and rendering are unnecessary?

My point is that many websites are using way too much technology for what they need to do, with correspondingly long load times and choppy runtime behavior.

Correct. But if the page is, at least in part, an art piece rather than an information dump, or needs to do interactive rendering for its purpose (an editor like the markdown example, live updating status displays, games and other interactive toys, etc), then the tech is necessary and this article is useful.

Re: The browser's main thread is expensive

#20

Earlier quoted context omitted.

My point is that many websites are using way too much technology for what they need to do, with correspondingly long load times and choppy runtime behavior.

Correct. But if the page is, at least in part, an art piece rather than an information dump, or needs to do interactive rendering for its purpose (an editor like the markdown example, live updating status displays, games and other interactive toys, etc), then the tech is necessary and this article is useful.

Which is something like less than one percent of websites, and this technology is deployed much, much more widely.
Post reply on HN