Live data from Hacker News

The browser's main thread is expensive

kciter.so

21–30 of 158 posts

Re: The browser's main thread is expensive

#21
> So what if off-screen posts were left as empty shells that only take up their height, and got filled with real content as they approach the screen?

Yeah fuck everyone doing that, hello Reddit, Outlook for Web or Bluesky. It makes searching on such "feed" pages with the browser's search function an utter pain in the ass, made worse by the fact that the platforms' own search functions are outright braindead.

Re: The browser's main thread is expensive

#22
This article concludes with the following statement:

> So much of development is trade-offs, and you have to choose according to the situation, which ultimately comes down to the developer’s experience and judgment.

It’s a great article, but I think it is a bit behind the ball in framing scheduling problems as a matter of “experience and judgment”. The problem of allocating work to a scarce resource is one of the oldest and most well-studied in all of computer science. It would make sense to go consult a textbook on the matter before trying to reinvent the wheel.

Re: The browser's main thread is expensive

#24
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!

Since when do images need more than just an tag and a bit of styling?

Re: The browser's main thread is expensive

#25
Brilliant, I had no idea about this stuff. Thanks for writing it up.

On the price ticket example, on my device (Samsung A15, mediocre phone from 2024) I get 11 fps with the slow example and 30 fps with the fast one. (15 if I scroll!)

Is that a case of the back pressure you mentioned?

All the other (fast) examples are 60 fps though :)

Re: The browser's main thread is expensive

#26

Earlier quoted context omitted.

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.

Again, correct. But “don't do this if you don't really need to do this” is rather pointless to say, hence is being downvoted, because people already being that sensible don't need to hear it, and those who are not are unlikely to listen. The comment is just noise, as unnecessary as the unnecessary animation and other gumf that it is railing against.

Re: The browser's main thread is expensive

#27

This article concludes with the following statement: > So much of development is trade-offs, and you have to choose according to the situation, which ultimately comes down to the developer’s experience and judgment. It’s a great article, but I think it is a bit behind the ball in framing scheduling problems as a matter of “experience and judgment”. The problem of allocating work to a scarce resource is one of the old…

Do you have any suggestions for books on the topic?

Re: The browser's main thread is expensive

#30
So this is AI slop written? Why would anyone believe I'd want to read AI spam?

Also, the issue I see is who controls browsers as much more profound. We need to find a solution here, as the browser is too important to allow private companies to keep mankind hostage.

Edit: Wow, and the praise-accounts. Is that new on hackernews?

Post reply on HN