What is Interaction to Next Paint (INP)? Core Web Vitals Explained
Deconstructing the three-phase browser Event Loop lifecycle - Input Delay, Processing Time, and Presentation Delay - and engineering sub-50ms responsiveness.
Direct Definition
Interaction to Next Paint (INP) is a Core Web Vital metric that quantifies end-to-end runtime responsiveness by measuring the elapsed duration from a discrete user input event (pointerdown, click, or keydown) to the exact hardware timestamp when the browser compositor paints the resulting visual frame.
The Three-Phase Anatomy of an INP Frame Cycle
Unlike legacy responsiveness metrics that terminated measurement as soon as an event handler began executing, INP spans the entire browser Event Loop turn until pixels are physically committed to the display buffer. Every qualifying user interaction is decomposed by the browser's PerformanceObserver API (via event and first-input entry types) into three contiguous execution phases:
| Lifecycle Phase | PerformanceEventTiming Interval | Primary Main-Thread Bottleneck | Target Ceiling |
|---|---|---|---|
| 1. Input Delay | processingStart - startTime | Pre-existing Long Tasks (>50ms), background script evaluation, or V8 Garbage Collection sweeps occupying the call stack. | < 10 ms |
| 2. Processing Time | processingEnd - processingStart | Synchronous JavaScript callbacks registered on pointerdown/click, state reconciliation, and third-party telemetry hooks. |
< 25 ms |
| 3. Presentation Delay | startTime + duration - processingEnd | Style recalculation, synchronous layout reflows (layout thrashing), pre-paint tree walks, and GPU rasterization commits. | < 15 ms |
To achieve a "Good" classification under Google's field data standards (CrUX 75th percentile), the sum of all three phases for the worst interaction (or 98th percentile on pages exceeding 50 interactions) must remain under 200 milliseconds. Crossing the 500ms threshold flags the origin as having poor responsiveness. Because a 60Hz display refreshes every 16.67ms, any third-party script that injects synchronous execution into Phase 2 immediately steals frame budget from the host application's UI update.
Synchronous Handler Contention vs Idle-Scheduled Telemetry
The most common cause of Phase 2 Processing Time inflation in production web applications is coupling behavioral event listeners directly to synchronous DOM queries or payload serialization. When a visitor clicks an interactive component, every listener attached to that event bubble executes sequentially before the browser can yield to the rendering pipeline.
Enforcing a strict Client-Side Latency Budget requires decoupling signal capture from the visual update cycle. By adopting a Zero DOM-Blocking Architecture, telemetry handlers record only lightweight primitive coordinates during the active event turn and defer computational work until after the next paint commits:
// Executes inside the active interaction frame
document.addEventListener('click', (e) => {
// Forces synchronous style & layout reflow
const rect = e.target.getBoundingClientRect();
const tree = e.target.outerHTML;
// Allocates transient strings & triggers GC
const payload = JSON.stringify({
x: e.clientX,
y: e.clientY,
bounds: rect,
snapshot: tree
});
// Stalls Presentation Phase by 35ms–90ms
sendSynchronousPayload(payload);
});
// Passive listener (<0.15ms execution cost)
window.addEventListener('pointerdown', (e) => {
const x = e.clientX;
const y = e.clientY;
const t = performance.now();
// Yield to compositor so Next Paint occurs first
requestAnimationFrame(() => {
requestIdleCallback(() => {
ringBuffer.writeVector(x, y, t);
}, { timeout: 100 });
});
}, { passive: true });
Eliminating V8 Garbage Collection Pauses During Interaction Bursts
Even when individual event callbacks appear fast in isolated profiler snapshots, rapid interaction sequences - such as multi-faceted catalog filtering or rapid keyboard input - frequently trigger sudden INP regressions due to V8 engine memory management. Allocating new JavaScript objects, closures, and JSON strings on every pointermove or click saturates V8's Young Generation (Nursery) heap space.
When the nursery fills, V8 triggers a Scavenger garbage collection pause that halts the main thread, inflating both Total Blocking Time (TBT) during page bootstrap and Phase 1 Input Delay during active sessions. Writing interaction telemetry into pre-allocated, fixed-length typed arrays prevents heap churn altogether, keeping main-thread execution deterministic and preserving sub-50ms INP across long-lived single-page application sessions.
Related Glossary Concepts
Engineered for Sub-50ms INP
Inspect how our passive listener pipeline and pre-allocated ring buffers capture behavioral intent without registering a single Long Task on the browser main thread.