Hacker News new | ask | show | jobs
by lelandfe 1491 days ago
Workers lack document access and have to schedule updates with the main thread. That puts us back where we started (plus the overhead of starting the web worker).

I don't know enough about the state of WASM today to say the same. Circa 2018 I know that it lacked DOM manipulation.

(In some distant year I will figure out the incantation to avoid getting sniped when talking about this stuff. I think I rewrote that line 4 times.)

1 comments

It doesn't put you back where you started at all. One thread aggregating the results from other workers and applying them to the DOM is not at all the same as a single thread doing all that work on its own.
Let me rephrase: distributing work to web workers won’t be faster in first page load than images in this conversation.

Because we have to participate in the main thread either way, prerendered images will always paint faster. There is simply too much action in the thread during the initial GitHub page lifecycle. The 40-50ms (~one long task) cost of spinning up a new web worker just solidifies that.