PureXML/docs
Mihaela Mihaljevic 2f8ca9b289
perf(parsing): byte-level scanning fast paths halve parse time vs libxml2 (#275)
Keep the reader on its byte fast path through dispatch and name/attribute
scanning so plain-ASCII documents avoid the per-Character String machinery
(String.Iterator.next, string comparison, small-string materialization,
bridge-object ARC) that a profile indicted as the parse bottleneck.

The root cause was that a single buffered lookahead Character defeated every
existing byte path, each of which requires an empty buffer, and the content,
markup, and attribute dispatch each peeked a Character before scanning. Add a
non-buffering peekByte for dispatch, a byte-mode skipSpace, an all-ASCII
takeASCIIName, and an attributeRunBytes bulk scanner (with the 3.3.3
whitespace-to-space transform, deferring any carriage return to the Character
path so CRLF is not double-counted). Detect a text run's closing '<' via
peekByte instead of buffering it, which had cascaded the next element's whole
dispatch and name scan onto the slow path. Skip reference decoding for
ampersand-free text. The Character path remains the exact fallback for a
streaming source, spliced entity text, and any non-ASCII byte; the two paths
share scanContentMarkup so they cannot diverge.

Measured parse 20.1x -> 9.5x slower than libxml2 on the 20k-item generated
corpus, roughly a 53 percent wall-clock reduction. A differential oracle pins
the byte and Character paths to identical event streams and error marks over
an adversarial corpus, alongside boundary tests. Verified against the full
local suite, the Apache Xalan XSLT gold-output corpus, the W3C XML conformance
corpora, the RELAX NG spec suite, and the WASM build. No spec behavior changed.
2026-06-24 18:46:58 +02:00
..
design docs(design): derive the exact Particle Valid (Restriction) procedure (#252) 2026-06-23 10:50:38 +02:00
plans fix(schema): a non-nillable element must carry no xsi:nil at all (cvc-elt.3.1) 2026-06-20 03:22:05 +02:00
rules Mirror mandatory Swift rules 2026-06-18 22:00:41 +02:00
benchmarks.md perf(parsing): byte-level scanning fast paths halve parse time vs libxml2 (#275) 2026-06-24 18:46:58 +02:00
onboarding-antigravity.md docs: correct the last stale valid-schemas-rejected figure 2026-06-19 23:32:04 +02:00
production-readiness.md docs: production-readiness standard, read every conformance iteration 2026-06-14 16:28:03 +02:00
release-hurdles.md fix(schema): attribute-wildcard union/intersection per Errata E1-10 (#251) 2026-06-23 04:56:17 +02:00
roadmap.md docs: align stale figures with code and the enforced XSTS gate 2026-06-19 23:32:04 +02:00
schema-validity-burndown.md fix(schema): carry global ref metadata into restrictions 2026-06-19 09:03:49 +02:00
validation-coverage-registry.txt feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
validation-field-registry.txt feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
xsts-deviations.md fix(schema): carry global ref metadata into restrictions 2026-06-19 09:03:49 +02:00