Web Performance Optimization & Lighthouse · レッスン

Interaction to Next Paint(INP)

実環境での応答性を測定するCore Web VitalであるINPについて、訪問中の計算方法と、操作を軽快に保つための手法を理解します。

レッスン 4/413 ステップ

「Interaction to Next Paint(INP)」はCoddyKit上の無料Web Performance Optimization & Lighthouseレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはWeb Performance Optimization & Lighthouse学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Web Performance Optimization & Lighthouseコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Responsiveness as a Vital

Interaction to Next Paint (INP) measures how quickly the page visually responds to user input across the whole visit. It became a Core Web Vital, replacing First Input Delay.

INP vs FID

FID only measured the first interaction's input delay. INP is broader: it considers all interactions and the full latency through event handling and rendering, not just the initial delay.

What an Interaction Includes

Each interaction's latency spans three parts: input delay (waiting for the main thread), processing time (event handlers), and presentation delay (rendering the next frame).

How INP Is Reported

Across a visit, INP reports roughly the worst interaction latency (with an allowance for outliers on pages with many interactions), so it reflects the user's worst-case responsiveness.

The Thresholds

  • Good: 200ms or less
  • Needs improvement: 200-500ms
  • Poor: over 500ms

The Main Thread Is the Bottleneck

Long tasks block the main thread so input cannot be handled promptly. Breaking up long JavaScript tasks is the single biggest lever for improving INP.

Yielding to the Main Thread

Break long work into chunks and yield so the browser can handle input between them. scheduler.yield() or a setTimeout based yield helps.

async function process(items) {
  for (const item of items) {
    handle(item);
    await new Promise(r => setTimeout(r, 0));
  }
}

Defer Non-Urgent Work

Update the UI immediately for feedback, then run heavy work afterward. Patterns like requestAnimationFrame for visual updates and deferring analytics keep handlers short.

button.addEventListener('click', () => {
  showSpinner();
  setTimeout(doHeavyWork, 0);
});

Reduce Rendering Cost

The presentation phase suffers from large DOM updates and expensive layout. Use content-visibility, virtualization, and minimal DOM changes to render the next frame faster.

Measuring INP

Capture INP in the field with the web-vitals library, and use the DevTools Performance panel's interaction track to see input delay, processing, and presentation for each event.

import { onINP } from 'web-vitals';
onINP(metric => console.log('INP', metric.value));

Improvement Checklist

  • Break up long tasks and yield.
  • Defer non-urgent work after paint.
  • Trim event handler work.
  • Reduce DOM size and rendering cost.

Quick Check

How does INP differ fundamentally from the metric it replaced, FID?

Recap

You learned INP measures whole-visit responsiveness across input delay, processing, and presentation, with a good threshold of 200ms. Improve it by breaking up long tasks, yielding to the main thread, deferring non-urgent work, and reducing rendering cost.

無料で開始

AI チューターと学ぶ Web Performance Optimization & Lighthouse — 無料

ブラウザでリアルコードを書いて実行し、24/7 の AI チューターから瞬時にサポートを受け、ウェブまたはアプリで続きから学習できます。

コース
12
レッスン
48

よくある質問

「Interaction to Next Paint(INP)」レッスンは無料ですか?

はい。「Interaction to Next Paint(INP)」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Web Performance Optimization & Lighthouseコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Web Performance Optimization & Lighthouseコースには全4レッスンが含まれています。

「Interaction to Next Paint(INP)」で何を学びますか?

実環境での応答性を測定するCore Web VitalであるINPについて、訪問中の計算方法と、操作を軽快に保つための手法を理解します。 ブラウザで直接実行するハンズオンコードでWeb Performance Optimization & Lighthouseを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Web Performance Optimization & Lighthouseを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのWeb Performance Optimization & Lighthouseは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。

「Interaction to Next Paint(INP)」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このWeb Performance Optimization & Lighthouseレッスンでコードを書いて実行できますか?

はい。すべてのWeb Performance Optimization & Lighthouseレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. Core Web Vitals入門
  2. LCP、FID、CLSを詳しく学ぶ
  3. ユーザー操作指標の改善
  4. Interaction to Next Paint(INP)
← Web Performance Optimization & Lighthouseに戻る