jargon

Comparison

Long taskvsMain thread

Long task

one function held the main thread for 300 milliseconds and every click during it queued up behind it.

Any task occupying the main thread for more than fifty milliseconds, during which the browser cannot respond to input or paint. It is the atomic unit of unresponsiveness: interaction latency is almost always a queue behind one of these. Breaking one up means yielding to the event loop between chunks, which is what `scheduler.yield` and the older `setTimeout` trick both do.

Full entry →

Main thread

your loop over ten thousand rows froze the whole tab, including the scroll and the spinner.

The single thread on which the browser parses, runs your JavaScript, computes style and layout, and paints. Because all of that is serialised, any script that runs for long blocks everything else, including the animation you added to reassure the user. This is the constraint every other performance term on this page is downstream of.

Full entry →

Related comparisons