Performance Hands-On 3 - Interaction to Next Paint (INP)

Instructions

In this hands-on, you will learn how to identify, measure, and improve INP using browser DevTools.

Task 1: Measure INP

  1. Open Chrome DevTools (press F12 or Ctrl+Shift+I / Cmd+Option+I)
  2. Go to the Performance panel
  3. Click the Start recording button (circle icon)
  4. Interact with the buttons below and observe their response time
  5. Stop the recording and analyze the results

Task 2: Analyze and Improve

  1. In the performance recording, look for long tasks in the Main thread
  2. Identify which button has the worst INP and why
  3. Open index.js and find ways to optimize the problematic code
  4. Focus on these optimization techniques:
    • Breaking up long tasks
    • Removing unnecessary synchronous work
    • Using requestAnimationFrame for visual updates
  5. Re-measure after your optimizations to verify improvement

Pro Tips

Test Your Knowledge

Click each button and observe their INP in DevTools. Can you identify which has poor INP and why?

Response Time: 0ms

Additional Resources