Interaction to Next Paint (INP)
Interaction to Next Paint (INP) measures responsiveness across all user interactions (clicks, taps, keyboard presses) throughout the entire lifespan of a webpage.
Buttons, inputs, and carousels respond immediately to taps.
Visible UI lag; users often double-click thinking the action failed.
Browser freezes noticeably; high bounce rate and poor SEO.
How to Fix Poor INP Scores
Yield control back to the main thread during heavy data parsing using scheduler.yield() or setTimeout(fn, 0).
Avoid running complex filter calculations on every single keystroke. Debounce search inputs by 150–250ms to keep typing fluid.
Complex DOM structures force expensive style recalculation and layout reflows whenever a class or attribute changes. Keep DOM nodes below 1,400.
Execute encryption, heavy mathematical operations, and local indexing in background Web Workers so the UI thread remains 100% responsive.