Skip to content

feat(wasm): stream XML records and benchmark runtimes - #70

Merged
nth-bailey merged 4 commits into
mainfrom
feat/wasm-streaming-benchmarks
Sep 23, 2026
Merged

nth-bailey merged 4 commits into
mainfrom
feat/wasm-streaming-benchmarks

Conversation

@nth-bailey

@nth-bailey nth-bailey commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Completes the next implementation slice of #47 after #69:

  • Add parseStream for schema-free record documents. It accepts a web ReadableStream or async iterable, emits each direct child once complete, and bounds retained record size with maxRecordBytes.
  • Test byte-by-byte chunks, split UTF-8, quoted tag delimiters, entities, CDATA, namespace prefixes, early emission, record limits, and incomplete documents in Node and Bun.
  • Add reproducible micro, medium, and 50 MB benchmark harnesses for Node, Bun, and headless Chromium; compare object output to fast-xml-parser, and include xml2js/DOMParser as separate references.
  • Publish the measured results, bundle size, and limitations in the benchmark docs. CI now smoke tests all three runtimes.

Scope and limitations

  • Streaming is for repeated direct children of one root and uses schema-free conversion. It buffers one complete child, plus temporary wrapper and Wasm copies. It does not incrementally parse a single huge child, support DTDs or mixed root text, or offer typed XSD streaming.
  • Measurements are exploratory on one repeated-record fixture; GC pause comparisons were not reliable, so no GC reduction claim is made.
  • This PR does not publish the npm package; that release task is tracked in Publish @polyxml/wasm to npm #71.

Verification

  • cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace -q
  • Wasm package build; 8 Node and 8 Bun tests
  • Node, Bun, and Chromium benchmark harnesses across small/medium/large tiers
  • npm audit clean, npm pack --dry-run includes stream helper
  • uvx zensical build --clean --strict

Closes #47

@nth-bailey nth-bailey mentioned this pull request Sep 23, 2026
5 tasks
@nth-bailey
nth-bailey merged commit 5cf91a9 into main Sep 23, 2026
28 of 29 checks passed
nth-bailey pushed a commit that referenced this pull request Sep 23, 2026
# [0.23.0](v0.22.0...v0.23.0) (2026-09-23)

### Features

* **wasm:** stream XML records and benchmark runtimes ([#70](#70)) ([5cf91a9](5cf91a9))
@nth-bailey
nth-bailey deleted the feat/wasm-streaming-benchmarks branch September 26, 2026 21:04
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.

[Target: Wasm & TS] WebAssembly Streaming Runtime (polyxml-wasm) for Node.js, Bun, and Browsers

1 participant