Interaction to Next Paint (INP) Issues
What This Means
Interaction to Next Paint (INP) is a Core Web Vital metric that measures page responsiveness by observing the latency of all user interactions throughout the page lifecycle. INP reports the longest interaction latency, representing the worst-case user experience when interacting with the page.
A good INP score is 200ms or less. Poor INP indicates:
- Slow response to user clicks, taps, or keyboard inputs
- Long-running JavaScript blocking the main thread
- Heavy DOM manipulation causing slow visual updates
- Unoptimized event handlers causing delays
Poor INP directly impacts user experience and SEO rankings.
How to Diagnose
Chrome DevTools
- Use Performance panel to record interactions
- Enable "Web Vitals" in the Performance panel
- Look for long tasks (>50ms) during interactions
- Check for layout shifts and style recalculations
Real User Monitoring
// Measure INP using web-vitals library
import {onINP} from 'web-vitals';
onINP(({name, value, rating, entries}) => {
console.log('INP:', value, rating);
entries.forEach(entry => {
console.log('Interaction:', entry.name, entry.duration);
});
});
Tools
- Chrome User Experience Report (CrUX) for field data
- Lighthouse (Lab data, may not capture real INP)
- WebPageTest for detailed interaction analysis
- Chrome DevTools Performance Insights
Common Culprits
- Heavy JavaScript execution during interactions
- Excessive DOM nodes (>1500 elements)
- Forced synchronous layouts (layout thrashing)
- Large bundle sizes causing parsing delays
General Fixes
- Break up long tasks - Use
setTimeoutorrequestIdleCallbackto yield to the main thread - Debounce and throttle event handlers - Limit the frequency of expensive operations during interactions
- Optimize JavaScript execution - Reduce script evaluation time and avoid blocking work
- Use web workers - Offload heavy computations to background threads
- Minimize DOM size - Reduce the number of DOM nodes to speed up rendering
- Optimize event handlers - Remove unnecessary event listeners and make handlers lightweight
- Implement code splitting - Load JavaScript on demand to reduce initial parse time
- Use CSS containment - Apply
contain: layout style paintto limit rendering scope - Avoid forced synchronous layouts - Batch DOM reads and writes separately
- Use
content-visibility- Defer rendering of off-screen content
Platform-Specific Guides
| Platform | Guide |
|---|---|
| React | Optimizing React Performance |
| Next.js | Performance Optimization |
| Vue | Performance Best Practices |
| Angular | Runtime Performance Guide |