Skip to content

structio 0.3.2

Choose a tag to compare

@stephenberry stephenberry released this 03 Sep 19:03
· 21 commits to main since this release

Faster JSON reading and string writing. No API or output change.

[dependencies]
structio = "0.3"

Changed

  • Faster JSON reading and string writing. Against Glaze on the benchmark documents, reading doubles went from 58% to 87% of its speed, mixed documents from 78% to over 100%, and signed integers, bools and strings moved up with them; string writing went from 91% to 94%. The float reader is now inlined into the array loop rather than called per element, out-of-line helpers no longer pin the parser's cursor to the stack, signs and bools are read without a branch on the data, digits are folded a word at a time rather than one at a time, integers of up to fifteen digits stay on the inlined path, and strings are copied as they are scanned. docs/performance.md has the measurements and the mechanisms.

Output and accepted input are unchanged, and the float scanner is checked bit for bit against the standard library on 200,000 generated literals. A 0.3.1 declaration reads and writes exactly the bytes it did.