Workers & Off-Main-Thread Work
Moving CPU work off the thread that owns the DOM: message passing, structured clone, transferables, and the isolation requirements the sharper primitives carry.
A second JavaScript realm with its own event loop and its own heap, and no access to the document at all — which is the design, not a missing feature.
`postMessage` is a one-way, asynchronous, unbounded queue with no return value — every request/response protocol on top of it is one you wrote.
Cloning copies — cost proportional to size, paid synchronously on both threads. Transferring moves ownership — near-free, and the sender loses access entirely.
`SharedArrayBuffer` gives two threads one block of memory — and requires COOP and COEP headers that most pages cannot adopt without breaking their third-party embeds.
Workers cost startup, message overhead, a second bundle and much harder debugging — and most slow frontends are not CPU-bound, so a worker fixes nothing.