Skip to content

Preserve Jsvalue with a slab instead of unstable abi methods#78

Open
ealmloff wants to merge 5 commits into
RReverser:mainfrom
ealmloff:preserve-without-internal-abi
Open

Preserve Jsvalue with a slab instead of unstable abi methods#78
ealmloff wants to merge 5 commits into
RReverser:mainfrom
ealmloff:preserve-without-internal-abi

Conversation

@ealmloff

Copy link
Copy Markdown

Currently serde-wasm-bindgen relies on the unstable wasm bindgen convert module to store raw indexes into the js object map which can break in any minor release.

This PR reworks the implementation to instead store a index into a slab of stashed jsvalues on the rust side instead of relying on that unstable abi. This makes serialization ~15% slower for preserved JsValues. My assumption is that this path is not performance critical since it serializes the same id string alongside every jsvalue.

@ealmloff ealmloff changed the title Use a slab instead of unstable abi methods Preserve Jsvalue with a slab instead of unstable abi methods Jun 11, 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