Skip to main content
InterviewHubPRO
Section Overview
Q18

Question 18 of 50

Part 2: Core Architecture & Implementation (Mid-Level)

36%
Web Vitals & Performance (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)

What are Long Tasks (>50ms) and Long Animation Frames (LoAF)?

senior LevelSystem Design

In Simple Words:

  • Long Task: Any JavaScript execution that monopolizes the browser main thread for longer than 50 milliseconds.
    • 50ms threshold: Human eyes perceive lag if a system fails to respond within 100ms. If a task takes $>50\text{ms}$, user input arriving mid-task will experience $>100\text{ms}$ delay.
  • LoAF (Long Animation Frames API):
    • The modern replacement for the Long Tasks API.
    • Attributes exactly which script URL, function name, and execution duration caused frame delays $>50\text{ms}$.