Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Performance

Measured on 2026-11-01 on an aarch64 workstation (Cortex-X925, 20 cores, single-threaded throughout), Rust 1.99, release profile. Reproduce with cargo bench -p gaebboss-core and cargo xtask corpus --dir <files>.

Stages, criterion

benchmarkinputthroughput
lex/bvbs-x83-10mbthe BVBS X83 repeated to 10 MB2.36 GiB/s
lex/corpus-largesta 75 MB real X8115.2 GiB/s
parse/bvbs-x83-10mbfull typed parse675 MiB/s
parse/corpus-largestfull typed parse2.59 GiB/s
items/oz-and-kindOrdnungszahl and kind per item4.5 M items/s
items/with-textsplus short and long text1.5 M items/s
items/totalscategory and bill sums22 M items/s
write/compacttyped tree back to XML497 MiB/s
write/prettyindented471 MiB/s

The synthetic file is dense: small items with long texts and many elements per byte. Real files carry more text per element, which is why the 75 MB X81 reads four times faster per byte.

Whole corpus, cargo xtask corpus

164 real-world files, 189.6 MB, DA XML 3.0 to 3.3:

stagethroughput
tokenize2585 MB/s (1.12 M nodes)
typed parse866 MB/s, 0 errors
items with texts3797 MB/s (28 418 items, 15.4 MB of text)
write back421 MB/s (76.4 MB written)

Warnings over the corpus: 800 unknown elements (vendor extensions such as Codetext and OZ, and HTML placed where the schema has none) and 9 duplicated Totals, all kept.

Why it is fast

  • One pass over the bytes with memchr builds a flat tape of spans; nothing is copied unless an entity has to be decoded.
  • Element names resolve through a generated length-switched match, no hashing.
  • The typed model stores spans and fixed-point decimals, so building it allocates one Vec per repeated field and nothing per string.
  • Readers and writers are generated per type as straight loops: no reflection, no per-value dispatch, no intermediate DOM.
  • Texts are rendered from the tape on demand, so a caller that never asks for a long text never pays for it.

perf is not available in the environment this was built in; the remaining profiling work is listed under limitations.