The browser's main thread is expensive
11–20 of 158 posts
Re: The browser's main thread is expensive
#12Re: The browser's main thread is expensive
#13I wish await in JavaScript could conditionally yield. Instead I end up having to use arounds like if (shouldYield()) await do yield();
Re: The browser's main thread is expensive
#14Re: The browser's main thread is expensive
#15Yeah, 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?
Re: The browser's main thread is expensive
#16Yeah, 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!
Re: The browser's main thread is expensive
#17Yeah, 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.
Re: The browser's main thread is expensive
#18Earlier 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.
Re: The browser's main thread is expensive
#19Earlier 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.
Re: The browser's main thread is expensive
#20Earlier 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.