The browser’s main thread is expensive

A browser window with a huge loading spinner rolling over colorful blocks on a road, a cartoon avatar, and the title “The Browser’s Main Thread Is Expensive” by Sunhyoup Lee.

Sunhyoup Lee walks through the one thread that runs JavaScript, styles, layout, paint, and events, with about 10 milliseconds per frame, half that on a 120Hz screen. Spend it better: split long tasks and yield with scheduler.yield(), batch events with debounce and throttle, prioritize by user impact, and defer the rest. Or hand it off to the compositor or a Worker. Interactive demos compare them.

kciter.so/posts/the-expensive-main-thread/en