perf(wasix): add direct OPFS storage fast path - #144
Draft
f0rr0 wants to merge 1 commit into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
FileSystemSyncAccessHandlepool, removing the extra storage-worker and whole-directory hydration path from supported dedicated-worker browsers./basematerialization with the existing storage lease lifecycle, including deterministic pool, lock, and host-filesystem cleanup on success and failure.Why / root cause
The previous OPFS provider hydrated PGDATA into a Wasmer in-memory
Directoryand persisted mutation snapshots. Even after the clean-break runtime moved PostgreSQL into the dedicated worker, storage still paid for that materialization and persistence bridge. The host lacked a synchronous caller-realm filesystem interface that WASIX could invoke directly.This change supplies that narrow host bridge and serves requests from the same dedicated worker through pooled synchronous OPFS handles. Browsers that cannot provide the required primitives retain the existing portable path. The public storage descriptor and factory surface do not change.
This PR does not claim a measured win over PGlite. Its benchmark tooling records matched topology and durability metadata so a comparative result can be qualified separately.
Release Intent
feat:,fix:,perf:,refactor:,revert:, or a breaking!.Verification
pnpm doctor(not exposed at this repository root)pnpm fmt:check(not exposed at this repository root)pnpm check(not exposed at this repository root)pnpm test— 19 files, 133 testspnpm release-check(not exposed at this repository root)Additional qualification:
bash src/bindings/wasix-ts/host/build-sdk.shmoon run liboliphaunt-wasix:runtime-portablemoon run sdk-contracts:check oliphaunt-wasix-ts:packagepnpm typecheckpnpm build && node tools/stage-host.mjs && pnpm package:checkanswers=[42,43], OPFS reopen answers1,2,3, pgTAP1.3, expected startup SQLSTATE3D000,directWorkers=0,opfsTransport=direct