Long Task
A long task is any piece of JavaScript code that monopolizes the Main Thread for a prolonged period (typically over 50 milliseconds), preventing it from responding to user input. While a long task is running, the browser cannot react to clicks or taps, making the page feel frozen and unresponsive. Long tasks are a primary cause of a poor Interaction to Next Paint (INP) score. The most effective way to optimize them is to break them into a series of smaller tasks, yielding control back to the main thread between each one.
Related web performance terms
- Lab Data (Synthetic Monitoring)
Lab data is performance data collected in a controlled, repeatable environment using tools like Google Lighthouse or WebPageTest.
- Largest Contentful Paint (LCP)
A Core Web Vital that measures the perceived loading speed of a page. It marks the point in time when the largest content element (usually a hero image or a large block of text) becomes visible within the viewport.
- Largest Contentful Paint Subparts
The LCP Subparts are the distinct phases that make up the total Largest Contentful Paint time. Analyzing this breakdown is crucial for diagnosing the root cause of a slow LCP.
- Layout Thrashing
Layout Thrashing is a harmful performance anti-pattern.