simdjson compiled to WebAssembly via cpp.js, shipped as a workspace package, and demonstrated in a Vue 3 + Vite app.
A browser benchmark that compares simdjson-wasm against the built-in
JSON.parse on JSON of varying sizes, all running in your browser.
The benchmark page (live at the configured custom domain in
packages/simdjson-example-vue/public/CNAME) does the following:
- Generates JSON client-side from a seeded PRNG (deterministic across runs).
- Runs each parser through warmup + measured iterations.
- Reports median, p95, throughput (MB/s), and speedup vs the
JSON.parsebaseline. - Discloses the methodology (worker-boundary copies, std::string overhead, etc.) so the numbers are honest.
Parsers compared:
JSON.parseon the main thread (baseline)JSON.parsein a Web Worker (apples-to-apples cross-thread cost)simdjson::domrunning in WASM (full DOM tape — closest toJSON.parsesemantics)simdjson::ondemandrunning in WASM (lazy iteration — typically the fastest)
packages/
simdjson-wasm/ # C++ → WASM build (via cpp.js + simdjson v4.3.1)
simdjson-example-vue/ # Vue 3 + Vite demo + benchmark page
pnpm install
pnpm --filter simdjson-vue-example dev
# open http://localhost:5173/ → benchmark
# open http://localhost:5173/#/demo → file-upload demopnpm --filter simdjson-vue-example build
pnpm --filter simdjson-vue-example preview- Push this repo to GitHub.
- Enable Pages in repo settings → set the source to GitHub Actions.
- Edit
packages/simdjson-example-vue/public/CNAMEto your domain (the file currently contains a placeholder). - Configure DNS:
- Apex domain (
example.com): A records to GitHub Pages IPs (185.199.108.153,.109.153,.110.153,.111.153) plus AAAA records (2606:50c0:8000::153etc.). - Subdomain (
bench.example.com): CNAME pointing to<user>.github.io.
- Apex domain (
- Push to
main. The workflow at.github/workflows/deploy.ymlbuilds and deploys. - Wait 5-60 minutes for HTTPS to provision.
The workflow runs pnpm --filter simdjson-vue-example build and uploads the resulting dist/ to Pages.
Note: The
large_test_data.json(1 GB) generated bypackages/simdjson-example-vue/generate_json.mjsis.gitignored on purpose — it exceeds GitHub's 100 MB per-file limit. The benchmark page generates its own JSON in the browser; the local-file demo expects you to generate the file locally if you want to test it.