What is a Tight Frame Budget? Enforcing Smooth Web Performance
Partitioning the 16.67ms (60Hz) and 8.33ms (120Hz) hardware VSync windows so third-party telemetry never starves host application rendering.
Direct Definition
A Client-Side Latency Budget is a deterministic runtime execution ceiling - enforced in milliseconds per animation frame - that restricts how long non-rendering JavaScript tasks may occupy the browser main thread before yielding back to the Event Loop compositor.
Deconstructing the 16.67ms and 8.33ms VSync Windows
Modern displays commit pixels on a strict vertical synchronization (VSync) hardware clock. On standard 60Hz panels, the browser has exactly 16.67 milliseconds (`1000ms / 60`) to process input events, execute JavaScript callbacks, recalculate CSS cascades, compute layout geometry, paint display lists, and hand composited layers to the GPU. On 120Hz ProMotion and LTPO OLED displays, that entire frame envelope shrinks to 8.33 milliseconds.
| Main-Thread Subsystem | 60Hz Frame Allocation (16.67ms) | 120Hz Frame Allocation (8.33ms) | Overrun Consequence |
|---|---|---|---|
| Browser Overhead & Compositor | ~4.00 ms | ~2.00 ms | Baseline OS & GPU IPC synchronization cost. |
| Host App JS, Style & Layout | ~8.67 ms | ~4.33 ms | React/Vue reconciliation and DOM tree reflow. |
| Nexolytix Telemetry Ceiling | ≤ 4.00 ms (Idle) | ≤ 2.00 ms (Idle) | Yields immediately if VSync deadline approaches. |
| Unbudgeted Legacy Script | 35.00 – 90.00 ms | 35.00 – 90.00 ms | Drops 3 to 10 consecutive frames; spikes INP. |
Even if a third-party script executes in 12ms, running that 12ms synchronously inside the same animation frame where the host application already requires 9ms of React state reconciliation pushes the combined frame time to 21ms - missing the 16.67ms VSync deadline and dropping the frame rate from 60fps to 30fps.
Self-Policing Execution via Idle Deadline Telemetry
To guarantee zero frame drops and protect Interaction to Next Paint (INP), a telemetry engine cannot rely on average execution speed; it must enforce a hard wall-clock budget at runtime. Within our Zero DOM-Blocking Architecture, high-frequency pointer and scroll coordinates are appended into a pre-allocated RAM Buffer Pipeline in less than 0.05ms, while vector normalization and batch framing run exclusively inside budgeted idle callbacks:
class FrameBudgetScheduler {
constructor(maxBudgetMs = 4.0) {
this.maxBudgetMs = maxBudgetMs;
this.taskQueue = [];
this.isScheduled = false;
}
enqueue(taskFn) {
this.taskQueue.push(taskFn);
if (!this.isScheduled) {
this.isScheduled = true;
requestIdleCallback((deadline) => this.flush(deadline), { timeout: 200 });
}
}
flush(deadline) {
const start = performance.now();
while (this.taskQueue.length > 0) {
const elapsed = performance.now() - start;
// Abort loop if internal 4ms budget or browser VSync deadline is reached
if (elapsed >= this.maxBudgetMs || deadline.timeRemaining() <= 1.0) {
break;
}
const nextTask = this.taskQueue.shift();
nextTask();
}
snippet
this.isScheduled = false;
if (this.taskQueue.length > 0) {
this.enqueue(this.taskQueue.shift());
}
}
}
Preventing Layout Thrashing and Micro-Task Starvation
A strict millisecond budget is only effective if tasks also avoid triggering deferred browser costs. Calling layout-reading DOM getters (such as offsetWidth, scrollTop, or getComputedStyle()) after a host framework has dirtied the DOM forces the browser engine to execute a synchronous style recalculation and layout reflow right inside the JavaScript call stack.
Similarly, queuing recursive Promise.then() micro-tasks drains the micro-task checkpoint completely before yielding to the next Event Loop turn, bypassing VSync boundaries entirely. By banning layout-triggering DOM reads during active frames and scheduling buffer flushes as cooperative macro-tasks, the client runtime remains strictly bounded under its 4ms latency ceiling.
Related Glossary Concepts
Keep 60fps & 120fps Rendering Uncompromised
See how our cooperative idle scheduler enforces a strict 4ms per-frame execution ceiling so host UI animations and interactions never drop a VSync cycle.