Public BetaVitalSentinel is now live! Read the announcement
Performance

What is JavaScript Execution Time?

The time the browser spends parsing, compiling, and executing JavaScript code, which can block the main thread and delay interactivity.

JavaScript execution time measures how long the browser spends running JavaScript code. Excessive JS execution can block the main thread, making pages feel sluggish.

Why JS execution matters

JavaScript runs on the main thread, which also handles:

  • User input processing
  • Layout and painting
  • Style calculations

Long JS execution blocks these operations, causing:

  • Delayed interactions
  • Poor INP scores
  • Janky scrolling

Measuring JS execution

Tools to measure:

  • Chrome DevTools Performance panel
  • Lighthouse "Reduce JavaScript execution time"
  • Web Vitals library

Reducing JS execution time

Reduce JavaScript

  • Remove unused code
  • Use tree shaking
  • Implement code splitting

Optimize JavaScript

  • Avoid expensive operations
  • Use efficient algorithms
  • Debounce/throttle handlers

Defer JavaScript

  • Use defer or async
  • Load on interaction (lazy)
  • Use web workers for heavy tasks

Target values

Lighthouse flags JS execution time over 2 seconds. Aim for under 1 second on mobile devices.

Monitor your website performance

VitalSentinel tracks Core Web Vitals and performance metrics to help you stay ahead of issues.