lukeed/tidyPublic

perf: one-pass JSON values

tidy::json::value built the syntax tree and then walked it. The parser
is now generic over what it builds, so values come straight from one
pass of the same grammar, with no tree. __proto__ is checked as keys
are read and still reported after the object ends.

Whitespace scanning stops at once on an ASCII byte, strings are
scanned with memchr, and number prefixes no longer allocate.

On the 3.25 MB JSON bench corpus: parse 7.84 -> 6.56 ms, value
18.27 -> 12.76 ms, against jsonc-parser's 11.35 ms (AST) and
14.83 ms (serde value).
LELuke Edwards authored
0d447afPatch
Parent35dfc9d
4 files changed+288-160
StackedSplit
crates/tidy/src/json/mod.rs+12 โˆ’10
crates/tidy/src/json/parse.rs+187 โˆ’83
crates/tidy/src/json/value.rs+88 โˆ’67
crates/tidy/src/syntax.rs+1 โˆ’0