Web Workers Playground

Rara runs the sack race one step per frame really painted: count the votes on the main thread or in a real Worker, and see what happens to the race; plus a 32…

Why it matters

A page’s JavaScript and its painting share one thread. One heavy loop freezes everything: animation stops, clicks go unanswered. A worker moves heavy work to another thread, but with no document, a cost per message, and data that is copied unless transferred.

The key idea

A worker frees the main thread, it does not speed the work up

Common mistakes

Try it in this playground