Improving INP: why a page feels slow to respond, and where to look
Investigate input delay, event processing and rendering work when a page feels slow to respond to user interactions.
Interaction to Next Paint (INP) measures how quickly a page responds when people click, tap or type. web.dev's guide to optimizing it (https://web.dev/articles/optimize-inp) states the thresholds: 200 milliseconds or less is good, over 500 is poor, and values above 200 through 500 need improvement. Assess the 75th percentile of field page loads, separately for mobile and desktop. Our Core Web Vitals article covers INP alongside LCP and CLS.
Step 1: find the slow interaction
web.dev says to start with field data from real users, ideally from a real-user monitoring provider, which can show which interaction caused the INP value, whether it happened during or after load, and its type (click, keypress, tap). Without that, it points to PageSpeed Insights, which shows Chrome User Experience Report data but with less context. Then reproduce the slow interaction in the lab by following common user flows and interacting with the page during load, when the main thread is often busiest.
Step 2: understand the three parts
web.dev splits an interaction into:
- Input delay: from the user's action until event handlers start running.
- Processing duration: the time event handlers take.
- Presentation delay: from handlers finishing until the next frame showing the result is painted.
Their sum is the interaction latency, so each part is a place to look. web.dev also notes that INP is reported at page level, including iframe interactions. Cross-origin access limits can make JavaScript-based monitoring differ from CrUX.
Step 3: what web.dev suggests for each part
- Input delay: caused by main-thread activity such as script loading, parsing and compiling, timers, fetch handling or overlapping interactions. Script evaluation during page load can create long tasks that delay responses. Reduce long tasks during startup.
- Event handlers: do as little work as possible; where you cannot, break the work into separate tasks (web.dev gives setTimeout as one way) so other interactions are not blocked. It also describes running only the logic needed for the next visual update first and deferring the rest.
- Presentation delay: keep the DOM small (rendering work grows with DOM size, though web.dev notes large DOMs cannot always be reduced much), consider the CSS content-visibility property for off-screen elements, and be careful rendering large amounts of HTML with JavaScript on the client.
Expect iteration
web.dev's conclusion: improving INP is iterative, fixing one slow interaction often reveals others, and it takes persistence. It gives no promised gain, and neither do we.
Questions for your developer
- What is our INP in field data, and which interaction is worst?
- How much JavaScript runs at startup?
- Do our click handlers do heavy work before the screen can update?
- How large is the page's DOM on our heaviest screens?
Limits
We did not read web.dev's linked guides on input delay, long tasks or content-visibility. Thresholds can change; check the live page.
By Omnistu.