PureXML/docs
Mihaela Mihaljevic fe0400c3df perf(parsing): byte-path quote handling, lazy expanded-name check, byte-scan entity guard
Third profile-guided pass (#139, docs/benchmarks.md pass 27), targeting
scanContentMarkup(), which inlines the start-tag/attribute/namespace scanners
and carries ~46% of parse time.

scanAttributeValue's opening and closing quote checks ran on the Character
path (peek + advance, buffering the quote as a Character only to compare and
discard it) on every attribute value in the document; both now check the raw
byte first, reaching the byte fast path with no Character buffering, with the
Character path kept as the off-fast-path fallback for streaming sources. The
quote bytes are ASCII and non-CR/LF, so the raw byte and the normalized
stream agree, the same reasoning peekByte's other callers already rely on.

NamespaceContext.checkExpandedNames allocated a Set's native storage and
built a concatenated URI+local key string per element even when at most one
attribute carries a namespace URI, where no duplicate is possible (the
default namespace never applies to attributes, and xmlns declarations carry
no URI). Counting URI-bearing attributes first, with no allocation, and
returning early below two skips all of it on the overwhelming majority of
elements; for xml:* attributes specifically the key exceeded the small-string
limit, so this also removes a real per-element heap allocation.

EntityDecoder.decode/decodeLenient guarded with raw.contains("&"), a
grapheme-by-grapheme walk to find one ASCII byte, once per ampersand-bearing
text node or attribute value; raw.utf8.contains(0x26) finds the same byte
without decoding graphemes, the same shape as checkNameShape's colon check.

The quote-handling extraction into two helpers also resolves the cyclomatic
complexity the inline version tripped. Six new regression tests pin the
quote edge cases (empty value, single-quoted, a quote kind nested inside the
other, unterminated at end of input) plus byte/Character-path agreement for
each in the parser path differential.

Verified: full local suite (1858 tests) and full W3C XSTS suite (14383
groups) pass unchanged. Parse ~6.00x -> ~4.75x versus libxml2 at the
20000-item corpus, best of 5.
2026-07-12 12:27:00 +02:00
..
design perf(schema): graph-structured-stack content matcher, killing the last 2^K content-model hang (#364) 2026-06-28 05:07:37 +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
benchmarks.md perf(parsing): byte-path quote handling, lazy expanded-name check, byte-scan entity guard 2026-07-12 12:27:00 +02:00
engineering.md chore(rules): pin rules-swift corpus, add gates and CI; drop redundant docs/rules mirror 2026-06-30 14:02:40 +02:00
mermaid.md chore(rules): pin rules-swift corpus, add gates and CI; drop redundant docs/rules mirror 2026-06-30 14:02:40 +02:00
onboarding-antigravity.md chore(test): add scripts/fetch-xsts.sh to obtain the XSTS corpus (#321) 2026-06-26 08:59:07 +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
research-first.md chore(rules): pin rules-swift corpus, add gates and CI; drop redundant docs/rules mirror 2026-06-30 14:02:40 +02:00
roadmap.md chore(codeberg): update links for NodetteHQ 2026-07-05 12:59:57 +02:00
rules-swift-audit.md chore(release): stamp 0.4.8 from main and repoint to codeberg.org/Mihaela 2026-07-05 05:31:16 +02:00
rules-swift-corpus.sha256 chore(rules): pin rules-swift corpus, add gates and CI; drop redundant docs/rules mirror 2026-06-30 14:02:40 +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 perf(model): make the value Node tree type depth-safe (#344) 2026-06-26 17:05:42 +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): literal RecurseAsIfGroup for a non-repeating base choice 2026-07-05 08:58:35 +02:00