Core Web Vitals (Part 3): Fix INP and Make Interactions Feel Immediate
Diagnose and improve Interaction to Next Paint by understanding input delay, event-handler work, rendering delay, long tasks, yielding, DOM cost, third-party JavaScript and real-user attribution.

A page can load in a second and still feel slow.
Click a menu and nothing happens. Type into a search box and the characters arrive in bursts. Change a filter and the interface freezes just long enough to make you click it again.
That is the territory of Interaction to Next Paint (INP).
A good INP is 200 ms or less at the 75th percentile. More than 200 ms up to 500 ms needs improvement; above 500 ms is poor.
The useful way to improve INP is not “reduce JavaScript” in the abstract. You need to understand which interaction is slow and which phase of that interaction consumed the time.
What INP is trying to capture
When somebody clicks, taps or presses a key, the browser cannot necessarily respond immediately.
It may already be busy. Then your event handlers run. Then the browser may need to recalculate styles, perform layout and paint the resulting frame.
A useful interaction model has three broad parts:
- input delay — time between the user’s input and your event callback beginning;
- processing duration — time spent executing the event’s callbacks;
- presentation delay — time after callbacks before the next frame can be presented.
If INP is 450 ms, knowing which of those dominates changes the fix completely.
Input delay: your handler may be innocent
Suppose a user clicks a navigation button at exactly the wrong moment while the main thread is busy executing a 300 ms analytics task.
Your click handler itself takes only 8 ms, but it cannot start until the existing work releases the main thread.
The interaction feels delayed because it was delayed.
This is why profiling only the handler can mislead you.
Look for long tasks occurring around interactions, including work that seems unrelated to the component being clicked.
Typical offenders include:
- large framework startup/hydration tasks;
- parsing/evaluating big JavaScript bundles;
- client-side data transformations;
- third-party tags;
- synchronous storage operations;
- huge DOM mutations;
- expensive observers/listeners;
- poorly scheduled background work.
Processing time: keep handlers focused
This is a bad interaction shape:
button.addEventListener('click', () => {
const result = calculateHugeReport(data);
renderHugeTable(result);
updateCharts(result);
savePreferences(result);
sendAnalytics(result);
});
Everything happens synchronously before the browser gets a chance to present useful feedback.
Ask which work is required before the next paint.
Maybe the user only needs the button state and loading indicator immediately:
button.addEventListener('click', async () => {
button.disabled = true;
status.textContent = 'Updating…';
await yieldToMainThread();
const result = calculateHugeReport(data);
renderHugeTable(result);
});
The exact yielding mechanism depends on your support target and application. The architectural point is stable: do not make one interaction own every piece of follow-up work synchronously.
Yielding is not the same as making work disappear
Breaking a 400 ms task into smaller chunks can make the page more responsive because the browser gets opportunities to process higher-priority work between chunks.
But the total CPU cost still exists.
If your app performs 400 ms of unnecessary computation, scheduling it more politely is useful — deleting or reducing the unnecessary work is better.
Optimisation order should usually be:
- remove work;
- reduce work;
- move suitable work off the main thread;
- schedule unavoidable main-thread work more cooperatively.
Long tasks are a warning sign, not the metric itself
A task taking more than roughly 50 ms is commonly described as a long task because it can block responsiveness.
Reducing long tasks is often an excellent INP strategy, but do not turn “zero long tasks” into another vanity metric.
A page may contain background long tasks that never collide with meaningful interactions, while a series of smaller but badly timed tasks can still produce an unpleasant interface.
Correlate main-thread activity with actual user interactions.
Presentation delay: the handler finished, but the frame is still late
You can optimise event-handler code and still have poor INP if the resulting render is expensive.
After JavaScript changes the DOM, the browser may need to perform:
- style recalculation;
- layout;
- paint;
- compositing.
Large DOMs and broad style invalidation can make this expensive.
Imagine a filter updates one small badge but your component architecture rerenders a table containing 10,000 rows. The click handler may look innocent in source code while the rendering consequence is enormous.
Use the Performance panel to see the browser work that follows the event.
Reduce DOM size because the browser has to maintain it
A giant DOM is not automatically slow, but it increases the amount of structure the browser and framework may need to inspect, style and update.
Common fixes include:
- paginate genuinely large result sets;
- virtualise long scrolling lists where appropriate;
- avoid rendering hidden tab content until needed;
- remove duplicate mobile/desktop DOM trees where one responsive structure would work;
- scope component updates;
- avoid rebuilding entire sections for tiny state changes.
Do not virtualise a list of twelve items because somebody told you virtualisation is “faster”. Complexity has a cost too.
Layout thrashing: stop forcing the browser back and forth
Code can accidentally alternate DOM writes and layout reads:
for (const card of cards) {
card.style.width = `${nextWidth}px`;
console.log(card.offsetWidth);
}
Reading geometry after changing styles may force the browser to synchronously calculate layout so it can return an accurate value.
Repeated across many elements, this can become expensive.
Prefer batching reads and writes where possible:
const widths = cards.map(card => card.offsetWidth);
cards.forEach((card, index) => {
card.style.width = `${Math.max(widths[index], nextWidth)}px`;
});
The details vary, but the principle is to avoid repeatedly forcing layout inside tight loops.
Framework rerenders: measure before reaching for memoisation everywhere
React, Vue, Angular and other frameworks can all produce excellent INP. They can also all be used to build slow interfaces.
A common failure mode is state being owned too high in the tree.
Typing one character into a search field causes:
- the page component to update;
- hundreds of child components to reevaluate;
- a large table to diff/render;
- charts to recompute;
- expensive effects to fire.
The fix may be component/state architecture rather than a clever JavaScript micro-optimisation.
Profile the update. Then narrow the state, cache genuinely expensive derived work, and avoid rerendering unrelated subtrees.
Do not scatter memoisation blindly. Memoisation itself has complexity and bookkeeping cost.
Debounce expensive secondary work, not basic feedback
Search-as-you-type often benefits from debouncing the network request or expensive filtering, but the input itself should remain responsive.
Bad:
input.addEventListener('input', debounce(() => {
inputValue.textContent = input.value;
runSearch(input.value);
}, 500));
Now even local feedback waits half a second.
Better conceptual split:
input.addEventListener('input', () => {
inputValue.textContent = input.value;
debouncedSearch(input.value);
});
Immediate interaction feedback and expensive follow-up work do not have to share the same schedule.
Move CPU-heavy work off the main thread where it makes sense
Web Workers can be excellent for substantial pure computation:
- parsing/transforming large datasets;
- client-side search indexing;
- image/data processing;
- complex calculations.
But workers cannot directly manipulate the DOM, and messaging/serialization has cost.
Do not move a 2 ms calculation into a worker just to say you use workers.
Use them where main-thread computation is materially interfering with responsiveness.
Third-party JavaScript is still your INP problem
Marketing tags, session replay, chat widgets, experimentation systems and ad code all compete for the same main thread as your application.
A third-party script can create input delay even if none of your handlers call it directly.
Inventory third parties and ask:
- does this need to run on every route?
- does it need to initialise immediately?
- can it load after consent/interaction/idle time?
- is the business value worth the main-thread cost?
- are multiple tools doing the same job?
The fastest version of an unnecessary tag is the one you remove.
Hydration and startup work can poison early interactions
A server-rendered page can look ready before its JavaScript is ready.
The user sees a menu, clicks it, and the main thread is busy hydrating a large application.
Visually fast, interactively slow.
Strategies vary by framework but include:
- shipping less client JavaScript;
- hydrating only interactive islands;
- deferring below-the-fold components;
- breaking hydration into smaller work;
- keeping static content static;
- avoiding huge synchronous startup effects.
Part 6 and Part 9 go deeper into JavaScript and framework architecture.
Give the user feedback before expensive work
Perceived responsiveness matters alongside the metric.
If clicking “Generate report” genuinely starts a long operation, change the interface immediately:
button.addEventListener('click', async () => {
button.disabled = true;
button.textContent = 'Generating…';
await startReport();
});
Do not leave the button visually unchanged while work happens, inviting double-clicks and uncertainty.
That does not excuse blocking the main thread, but good interaction design and good performance usually point in the same direction.
Measure INP in the field with attribution
A site-wide p75 INP tells you there is a problem. It does not tell you what to fix.
Capture enough context to answer:
- which route?
- which element/interaction?
- what interaction type?
- how much was input delay?
- how much was processing?
- how much was presentation delay?
- which release introduced the regression?
- which device class suffers most?
If one “Apply filters” button accounts for 40% of poor interactions, that is extremely actionable.
If your dashboard says only INP = 347, you still have detective work to do.
Reproduce slow devices, not just slow networks
INP is often CPU-sensitive.
Network throttling is not enough.
A modern desktop CPU can execute JavaScript dramatically faster than a mid-range phone. Use CPU throttling for diagnosis and, where possible, test representative physical hardware.
This is especially important for JavaScript-heavy dashboards and ecommerce interfaces.
An INP debugging workflow
Step 1: find the slow interaction in RUM
Start with real users and route/component attribution.
Step 2: reproduce it
Use DevTools Performance/Live Metrics under representative CPU conditions.
Step 3: split the latency
Determine whether the dominant cost is input delay, handler processing or presentation.
Step 4: inspect surrounding long tasks
A task before the event can be just as important as code inside the handler.
Step 5: remove unnecessary synchronous work
Do less before the next paint.
Step 6: reduce rendering scope
Check DOM size, rerenders, style/layout work and expensive component updates.
Step 7: yield or offload remaining expensive work
Use scheduling or workers where appropriate.
Step 8: verify on constrained hardware
Then verify in RUM after release.
A fast load is only half the experience
Use SiteTidy to inspect the delivery and page issues surrounding your performance investigation, then profile the interactions themselves in browser tooling and RUM.
Common INP mistakes
Replacing FID with INP in the dashboard but changing nothing else
INP is not simply “FID with a different threshold”. It captures a broader interaction story.
Optimising only the slowest handler
Input and presentation delay matter too.
Running everything through setTimeout(..., 0)
Scheduling tricks do not remove expensive work and can create their own ordering problems.
Debouncing every interaction
Deliberately delaying feedback can make an interface feel worse.
Blaming the framework
Framework choice matters less than the amount and shape of work you ask it to perform.
Ignoring third parties
They use your users’ CPU whether you wrote them or not.
Testing only during initial page load
INP represents interactions throughout the visit. Long-lived applications can accumulate state, DOM and work that makes later interactions worse.
Production checklist
For a poor-INP route:
- identify the real interaction rather than guessing;
- break latency into input, processing and presentation phases;
- find long tasks around the interaction;
- remove unnecessary work before the next paint;
- reduce expensive rerender scope;
- avoid forced synchronous layout loops;
- virtualise genuinely large UI collections where appropriate;
- defer non-critical startup/hydration work;
- move substantial computation to workers where beneficial;
- audit third-party main-thread cost;
- provide immediate visual feedback;
- test CPU-constrained devices;
- monitor interaction attribution by release in RUM.
A responsive application is not one that never performs expensive work. It is one that does not make the user wait unnecessarily while that work happens.
Part 4 tackles the third Core Web Vital: CLS — and why layout stability is mostly a matter of reserving space and designing asynchronous UI deliberately.
