cleverjam / binding-parser-rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

binding-parser-rs

An experiment to see what potential performance impacts there are for writing this binding parser in rust -> wasm

This is a pretty much a 1:1 port w/o any optimizations in place.

Benchmark in node (i9-12900k, 64GB ram)

┌─────────┬─────────────┬──────┬────────────────────┐
│ (index) │    name     │ time │     opsPerSec      │
├─────────┼─────────────┼──────┼────────────────────┤
│    0    │ 'parsimmon' │ 236  │ 131355.93220338985 │
│    1    │   'ebnf'    │ 1821 │ 17023.61339923119  │
│    2    │  'custom'   │  37  │ 837837.8378378379  │
│    3    │   'rust'    │ 145  │ 213793.10344827588 │
└─────────┴─────────────┴──────┴────────────────────┘

TODO bench it in a browser

To test it in node:

wasm-pack build --target nodejs
node --experimental-modules --experimental-wasm-modules  .\src\index.mjs

About

License:Apache License 2.0


Languages

Language:Rust 76.5%Language:JavaScript 23.5%