Yield between inbound sync apply batches - #166
Open
marcus-pousette wants to merge 1 commit into
Open
Conversation
marcus-pousette
force-pushed
the
fix/remote-apply-scheduler
branch
from
June 4, 2026 11:23
48ab5ef to
7a95c36
Compare
marcus-pousette
force-pushed
the
fix/remote-apply-scheduler
branch
from
July 12, 2026 13:44
7a95c36 to
eee9e75
Compare
marcus-pousette
changed the base branch from
codex/runtime-perf-benchmark
to
main
July 12, 2026 13:44
marcus-pousette
marked this pull request as ready for review
July 12, 2026 14:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
opsBatch.Why
Without a scheduling gap, several already-queued remote batches can monopolize the worker event loop. A foreground read or write that arrives after one batch finishes is then forced to wait behind the next batch even though per-filter ordering does not require that starvation.
This does not make OPFS writes themselves faster. It makes queued sync work cooperative with foreground work.
Fast paths left
Debloat
The original PR was stacked on #164 and included 137 lines of runtime benchmark changes. Those benchmark files and the benchmark ancestry are removed. The review is now 3 files, +83/−1; 74 added lines are the timing/order regression.
Verification
@treecrdt/sync-protocol: 24/24 tests pass.git diff --checkpass.