Full answer
A single INP number does not say why it is slow. The next step is attribution: for the slow interactions, record which element was used and how the time was spent.
The Event Timing API gives three timestamps for each interaction. From them:
- Input delay is
processingStart - startTime. A large value means the main thread was busy when the user clicked. The cause is some other task, such as a timer, a third-party script or a data refresh. The handler itself is not at fault. - Processing time is
processingEnd - processingStart. A large value means the handlers are slow. A new framework wrapper, a new listener on the same event or a heavier state update are typical causes. - Presentation delay is the rest of the duration after the handlers end. A large value means style, layout and paint cost too much. A new large DOM, a new layout-heavy CSS rule or a list that renders many nodes can cause it.
The plan after a regression:
- Send the three values, the event type, a short selector for the target and the release number from your RUM script.
- Compare the 75th percentile of each phase before and after the release. One phase will have moved most.
- Group by target and page template. A regression is often in one component.
- Reproduce on a throttled mobile profile with the Performance panel open. Chrome also offers the Long Animation Frames API, which names the scripts that ran in a slow frame, but support outside Chromium browsers is limited, so check the support table.
- Fix the biggest phase, deploy to a small share of traffic, and compare the field numbers again.
The snippet below turns an event entry into the three values. The test page blocks the main thread for 300 milliseconds every half second, so a click that lands in a busy window shows a large input delay while the handler stays fast. The test clicks several times and reads the worst one.
<button id="buy">Buy</button>
<script>
buy.addEventListener('click', () => { buy.textContent = 'Added'; });
window.parts = null;
new PerformanceObserver((list) => {
for (const e of list.getEntries()) {
if (e.name !== 'click') continue;
if (window.parts && window.parts.inputDelay >= Math.round(e.processingStart - e.startTime)) continue;
window.parts = {
inputDelay: Math.round(e.processingStart - e.startTime),
processing: Math.round(e.processingEnd - e.processingStart),
presentation: Math.round(e.startTime + e.duration - e.processingEnd),
target: e.target && e.target.id,
};
}
}).observe({ type: 'event', durationThreshold: 16, buffered: true });
// Stands in for a polling or third-party script that blocks the main thread.
function blockMain(ms) { const end = performance.now() + ms; while (performance.now() < end) {} }
setInterval(() => blockMain(300), 500);
</script>Run in headless Chrome 156 through Playwright. Two full runs gave the same results. Run with real mouse clicks while the page blocked the main thread. The worst click showed about 270 ms of input delay and almost no processing time. The numbers vary by machine.
Key points
- INP splits into input delay, processing time and presentation delay.
- Compute the split from Event Timing entries and send it with the release and target.
- The phase that grew most points at the kind of fix.
- Input delay is caused by other work, not by the handler.
- Confirm with a staged rollout and field data.
Common mistakes
- Profiling only the handler when the delay is in the queue before it.
- Looking at the average, which hides the slow tail.
- Reproducing on a fast desktop where the regression does not appear.
- Fixing a rare interaction because it was easy to reproduce.
Follow-ups
- What would a large presentation delay with a small processing time suggest?
- How does a third-party script cause a large input delay?
- How would you protect against this regression in CI?
Tips
- Name the three phases and what each one points to.
- Describe a rollout plan, not only a diagnosis.