Skip to content

perf(wa-sqlite): bypass queued materialization broadcasts - #163

Open
marcus-pousette wants to merge 3 commits into
fix/wa-sqlite-opfs-init-fallbackfrom
codex/shared-worker-materialized-fastpath
Open

perf(wa-sqlite): bypass queued materialization broadcasts#163
marcus-pousette wants to merge 3 commits into
fix/wa-sqlite-opfs-init-fallbackfrom
codex/shared-worker-materialized-fastpath

Conversation

@marcus-pousette

@marcus-pousette marcus-pousette commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

SharedWorker materialization notifications are one-way events, but they currently travel through the request/response RPC path. Every event therefore allocates a request ID and promise and occupies both the client and worker queues while writes are already active.

This PR sends those notifications as typed port messages instead. It removes broadcastMaterialized from the RPC schema while preserving the existing event payload and cross-tab propagation behavior. Delivery remains best-effort when a port is closing or has failed.

Scope

This is a performance and contention reduction. It does not change SQLite writes, materialization semantics, initialization, database drop, or reload handling.

Stack

Depends on #208. After merging this PR with a merge commit, retarget #209 to main.

@marcus-pousette
marcus-pousette force-pushed the codex/shared-worker-materialized-fastpath branch 2 times, most recently from 1b4ef0c to 46f9570 Compare June 3, 2026 13:27
@marcus-pousette
marcus-pousette marked this pull request as ready for review June 3, 2026 13:50
@marcus-pousette marcus-pousette added performance Measurable runtime, storage, or responsiveness improvement area:materialization Derived tree state, replay, outcomes, events, and materialization cursors area:web Browser, WASM, OPFS, workers, and playground runtime labels Jul 12, 2026
@marcus-pousette
marcus-pousette force-pushed the codex/shared-worker-materialized-fastpath branch from 77831c9 to 36bceea Compare July 12, 2026 15:34
@marcus-pousette marcus-pousette changed the title Avoid queued shared-worker materialization broadcasts perf(wa-sqlite): bypass queued materialization broadcasts Jul 12, 2026
@marcus-pousette
marcus-pousette changed the base branch from main to fix/wa-sqlite-opfs-init-fallback July 12, 2026 15:35
@marcus-pousette
marcus-pousette force-pushed the fix/wa-sqlite-opfs-init-fallback branch from 23728ac to ed2a220 Compare July 13, 2026 14:31
@marcus-pousette
marcus-pousette force-pushed the codex/shared-worker-materialized-fastpath branch from 36bceea to d61997c Compare July 13, 2026 14:31
@marcus-pousette
marcus-pousette force-pushed the fix/wa-sqlite-opfs-init-fallback branch from ed2a220 to f57f74c Compare July 14, 2026 20:36
@marcus-pousette
marcus-pousette force-pushed the codex/shared-worker-materialized-fastpath branch from d61997c to f8be4fe Compare July 14, 2026 20:37
@marcus-pousette
marcus-pousette force-pushed the codex/shared-worker-materialized-fastpath branch from f8be4fe to 5b6831f Compare July 15, 2026 06:45
@marcus-pousette
marcus-pousette force-pushed the fix/wa-sqlite-opfs-init-fallback branch 2 times, most recently from f36e6d7 to 7f7b5e3 Compare July 15, 2026 07:16
@marcus-pousette
marcus-pousette force-pushed the codex/shared-worker-materialized-fastpath branch from 5b6831f to 6a918bb Compare July 15, 2026 07:16
@marcus-pousette
marcus-pousette force-pushed the fix/wa-sqlite-opfs-init-fallback branch from 7f7b5e3 to b10857c Compare July 15, 2026 08:01
@marcus-pousette
marcus-pousette force-pushed the codex/shared-worker-materialized-fastpath branch from 6a918bb to 391a65f Compare July 15, 2026 08:01
@marcus-pousette
marcus-pousette force-pushed the fix/wa-sqlite-opfs-init-fallback branch 2 times, most recently from 853fa52 to 386c1bd Compare July 16, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:materialization Derived tree state, replay, outcomes, events, and materialization cursors area:web Browser, WASM, OPFS, workers, and playground runtime performance Measurable runtime, storage, or responsiveness improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant