Skip to content

How to improve INP

Reduce main-thread blocking, break up long tasks, yield to the browser.

INP optimization

  1. Break long tasks

    Any task >50 ms blocks input. Split into chunks with scheduler.yield() or setTimeout(..., 0).

  2. Defer heavy JS

    Third-party analytics, chat widgets, A/B tools — load after interaction, not before.

  3. Optimize event handlers

    Debounce/throttle scroll and input. No sync XHR. No forced reflow in click handlers.

  4. Use `content-visibility: auto`

    Renders offscreen content lazily, freeing the main thread.

  5. Web Workers for expensive work

    Parsing JSON >50ms? Move it off the main thread.