Skip to content

perf(zero-cache): batch replication write-worker messages - #5

Closed
Karavil wants to merge 1 commit into
capy/rm-vs-load-change-processor-batchingfrom
capy/rm-vs-load-worker-batching
Closed

perf(zero-cache): batch replication write-worker messages#5
Karavil wants to merge 1 commit into
capy/rm-vs-load-change-processor-batchingfrom
capy/rm-vs-load-worker-batching

Conversation

@Karavil

@Karavil Karavil commented May 26, 2026

Copy link
Copy Markdown
Owner

what changed

Adds write-worker message batching and keeps legacy commit-boundary flushing for the existing subscribe path.

benchmark output

Targeted run on this branch, medium-wide-batch-pressure, 15s:

worker-message tx/s: 946.6
worker-batch tx/s: 969.9
worker-message rows/s: 18,932.1
worker-batch rows/s: 19,397.4
avg VS tx apply: 0.731 ms -> 0.585 ms

validation

pnpm exec vitest --project='*no-pg*' run src/services/replicator/worker-message-batcher.test.ts src/services/replicator/write-worker.test.ts bench/rm-vs-load/config.test.ts bench/rm-vs-load/scenarios.test.ts bench/rm-vs-load/workloads.test.ts
pnpm run check-types
pnpm exec oxlint --config ../../oxlint.config.ts src/services/replicator/worker-message-batcher.ts src/services/replicator/worker-message-batcher.test.ts src/services/replicator/write-worker.ts

Why: avoid one worker-thread round trip for every RM stream row while preserving commit and rollback boundaries

* add processMessages() to the write-worker client protocol

* add WorkerMessageBatcher for bounded transaction-shaped batches

* expose worker-batch mode in the RM vs load benchmark
@Karavil
Karavil force-pushed the capy/rm-vs-load-worker-batching branch from 16e39ec to 7338bf8 Compare May 26, 2026 19:02
@Karavil
Karavil force-pushed the capy/rm-vs-load-change-processor-batching branch from 388a68c to 379603c Compare May 26, 2026 19:02
@Karavil

Karavil commented May 26, 2026

Copy link
Copy Markdown
Owner Author

Replaced by rocicorp/mono PRs rocicorp#6070 through rocicorp#6078.

@Karavil Karavil closed this May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant