Interaction to Next Paint (INP) measures the responsiveness of a webpage. Whether it’s a click, keyboard, or finger tap, INP takes an inventory of every interaction and measures the one that results in the longest response. For example, if a page responds almost instantly when you scroll but takes half a second to register typing on a keyboard, that half second will be used for the INP score.
Some functions will take longer than others, even when prioritizing a fast response time. To even things out, it’s best to measure the 75th percentile of interaction times. An INP of 200 milliseconds or below is considered good. Somewhere between 200 and 500 milliseconds means the page needs improvement, and an INP over 500 milliseconds is considered poor.
Ways to improve your INP score include:
- Yield to the main thread: Browsers continuously run tasks, a process often referred to as the main thread. Yielding to the main thread means pausing these tasks to prioritize user interactions.
- Reduce unnecessary code: JavaScript can consume a lot of data. Reducing or removing unnecessary data can decrease the time it takes to load your site and increase responsiveness.