I think that the original name conveys the concept really well, but it does not have a catchy acronym. So the graph taken from the original Google Docs on the metric in the case study for the metric, it showcases a series of events that the browser would take in order to be able to compute time to interactive. And we also can use the official chart taken from the web.dev first input delay article to see how the time to interactive and first input delay are connected.
So the time to interactive, it measures backwards the total time for the browser that the browser took from the start of the response all the way to when the browser has a five second window of five second quiet window. And in order to assess and gauge how the browser is able to respond reliably to user interactions. First input delay measures the very first interaction and assesses any delay on handling input. The first input delay metric was a good start. In attempt to assess the disruption and jank on serving the first interaction, give you a number in milliseconds on how much time that interaction response got delayed with them with the metric at first input delay came with some eye and the metric also came with some recommendations on how to avoid slow interactions. With that, we also got total blocking time as a lab metric to help us measure the total impact on long tasks.
So this metric is not necessarily connected to user interactions, but instead it measures how much work is being done on the main thread which can impact the user's interactions and visual updates that need to happen during that time. This metric though used by lab tools such as Lighthouse to measure the impact on long tasks during the load time is not necessarily a load time metric, but instead measures a measurement of long tasks blocking the main thread over time. Since the rail model's inception, we try to understand the impact of a busy main thread on our users experience with fancy acronyms and mental models to help us divide work and better understand the impact of long tasks when trying to keep a responsive and delightful user experience as a key result. Speaking of long tasks, the long task API is another important milestone. If total blocking time is the total blocking time over a period of time, the long task API provides us granular access to all of the long tasks that happened over such a period of time, giving you some form of enumeration and basic attribution model over those entries. Although it was a step into the right direction, it did not solve our problems. The basic attribution model gives us more granularity and some information on each long task, but it fails to give us proper insight over which script or function it might have been attributed to, giving you not much more than a timestamp and a total blocking duration. This quote actually comes from the article on long animation frames on the shortcomings of the long task API, which is another point to another point is that if you only consider long tasks as a source of interactivity problems, you're eliminating an entire class of performance problems that has to do with styling and layout, that also will occupy the main thread preventing the browser from responding to interactions and slowing down the production of new frames.
And so with that knowledge, the Chrome team started investigating on how could they create a better user-centric responsiveness metric, one that could observe not only the load time, but post load time as well, as part of the user experience. And also encompasses all of the parts that might be causing slow interactions. This image is taken from the article towards a better responsive metrics that precedes the announcement of INP. And you can already see a lot of resemblance on how INP as a metric functions and identify some of its parts. You can see the input delay section, the processing time section, and the next frame being shaped as a full account of the interaction duration. This is also represented on DevTools, nowadays at least. On the interactions track on the performance panel, you see the input delay and the presentation delay as whiskers on each side of the of the input event. And the processing time as the solid bar, representing the totality of the interaction duration. So all of those three parts account for the interaction. And with all the call frames within the stack being displayed underneath on the main thread track, which now gets us back to INP and long animation frames. So let's start with INP. INP, as a Core Web Vitals, tries to assess the page overall responsiveness by giving you a score based on the longest interaction observed. INP, similar to CLS, is a session-wide metric.
Comments