Sync Scheduler

← Notifications
STRVCT

Coalescing, deduplication, and event-loop-deferred method execution in SvSyncScheduler.

Overview

When multiple property slots mutate rapidly within a single user gesture (or batch data load), triggering a full UI re-render pass for every individual setter call would cause severe performance degradation and layout thrashing.

SvSyncScheduler solves this by coalescing and deduplicating target and method calls within the browser event loop:

N Rapid Slot Mutations Schedules syncFromNode() SvSyncScheduler Deduplicates target/method End of Event Loop Executes 1 single UI pass 100 slot property mutations in 1 frame trigger exactly 1 UI render pass at the end of the loop.

Usage Pattern

Views and persistent objects register deferred sync requests with SvSyncScheduler:

// Schedule a deferred method execution
SvSyncScheduler.shared().scheduleTargetAndMethod(view, "syncFromNode");

Regardless of how many times scheduleTargetAndMethod(view, "syncFromNode") is invoked during the current event loop, view.syncFromNode() executes exactly once when the scheduler flushes.