PureXML/Sources/Parsing
Mihaela Mihaljevic 7a5761b64d
perf(parse): split the name prefix from a scanned colon offset (#292)
QualifiedName(_:) ran firstIndex(of: ":") over the whole name, grapheme by
grapheme, on every element and attribute. Most names have no prefix, so the
common case scanned the entire name to find no colon at all.

The byte scanner already visits every byte of an all-ASCII name, so have
takeASCIIName record the offset of the first colon (one comparison per byte),
and split at that known offset in QualifiedName(ascii:colonOffset:). The
unprefixed name (no colon) is then built with no scan; a prefixed name splits
at the recorded offset. The names are identical to the firstIndex path for
every colon placement: none, leading (:local), trailing (prefix:), middle,
doubled (::), and multiple (first colon wins). The hint is confined to the
all-ASCII fast path; non-ASCII names and every other construction site keep
QualifiedName(_:).

Measured parse ~12% faster on the 20k-item generated corpus via a same-state
A/B (8.5x to ~7.7x slower than libxml2). Verified by QualifiedNameColonHintTests
(colon-placement differential), the W3C XML conformance corpora, the Xalan XSLT
gold-output corpus, the full suite, the WASM build, and an adversarial
equivalence review.
2026-06-25 12:23:53 +02:00
..
Big5Decoder.swift feat(parsing): Big5 (Traditional Chinese / HKSCS) 2026-06-09 08:30:57 +02:00
Big5Table1.swift feat(parsing): Big5 (Traditional Chinese / HKSCS) 2026-06-09 08:30:57 +02:00
Big5Table2.swift feat(parsing): Big5 (Traditional Chinese / HKSCS) 2026-06-09 08:30:57 +02:00
Big5Table3.swift feat(parsing): Big5 (Traditional Chinese / HKSCS) 2026-06-09 08:30:57 +02:00
Big5Table4.swift feat(parsing): Big5 (Traditional Chinese / HKSCS) 2026-06-09 08:30:57 +02:00
Big5Table5.swift feat(parsing): Big5 (Traditional Chinese / HKSCS) 2026-06-09 08:30:57 +02:00
Big5Table6.swift feat(parsing): Big5 (Traditional Chinese / HKSCS) 2026-06-09 08:30:57 +02:00
Big5Table.swift feat(parsing): Big5 (Traditional Chinese / HKSCS) 2026-06-09 08:30:57 +02:00
ByteDecoder.swift feat(parsing): fatal encoding-declaration contradictions, E38 version rule 2026-06-10 08:16:08 +02:00
ByteEncoder.swift feat(emitting): CJK output encodings, closing output-encoding parity 2026-06-09 09:41:28 +02:00
ByteStorage.swift perf(parsing): byte-backed Reader and bulk content runs 2026-06-10 18:48:57 +02:00
CharacterClassification.swift perf(parsing): byte-level scanning fast paths halve parse time vs libxml2 (#275) 2026-06-24 18:46:58 +02:00
CJKByteEncoder.swift feat(emitting): CJK output encodings, closing output-encoding parity 2026-06-09 09:41:28 +02:00
Diagnostic.swift feat(parsing): Namespaces 1.0 constraint enforcement 2026-06-10 08:06:45 +02:00
DoctypeScanner.swift refactor(validation): located structured validity findings 2026-06-10 10:45:17 +02:00
DoctypeScannerConditional.swift refactor(validation): located structured validity findings 2026-06-10 10:45:17 +02:00
DoctypeScannerEntities.swift refactor(validation): located structured validity findings 2026-06-10 10:45:17 +02:00
DoctypeScannerStrict.swift refactor(validation): located structured validity findings 2026-06-10 10:45:17 +02:00
DocumentType.swift refactor(validation): located structured validity findings 2026-06-10 10:45:17 +02:00
DTDAttListGrammar.swift feat(parsing): scalar-level lexing, xmlconf archive fully conformant 2026-06-10 08:40:26 +02:00
DTDContentModelGrammar.swift feat(parsing): scalar-level lexing, xmlconf archive fully conformant 2026-06-10 08:40:26 +02:00
EntityDecoder.swift perf(parse): bulk-copy literal runs in the entity decoder (#291) 2026-06-25 11:45:02 +02:00
EntityReplacementGrammar.swift feat(parsing): scalar-level lexing, xmlconf archive fully conformant 2026-06-10 08:40:26 +02:00
EntityResolver.swift
EUCJPDecoder.swift
EUCKRDecoder.swift feat(parsing): EUC-KR (CP949) decoding with vendored index (#99) 2026-06-09 08:02:14 +02:00
EUCKRTable1.swift feat(parsing): EUC-KR (CP949) decoding with vendored index (#99) 2026-06-09 08:02:14 +02:00
EUCKRTable2.swift feat(parsing): EUC-KR (CP949) decoding with vendored index (#99) 2026-06-09 08:02:14 +02:00
EUCKRTable3.swift feat(parsing): EUC-KR (CP949) decoding with vendored index (#99) 2026-06-09 08:02:14 +02:00
EUCKRTable4.swift feat(parsing): EUC-KR (CP949) decoding with vendored index (#99) 2026-06-09 08:02:14 +02:00
EUCKRTable5.swift feat(parsing): EUC-KR (CP949) decoding with vendored index (#99) 2026-06-09 08:02:14 +02:00
EUCKRTable6.swift feat(parsing): EUC-KR (CP949) decoding with vendored index (#99) 2026-06-09 08:02:14 +02:00
EUCTWDecoder.swift refactor(parsing): drop slice copies; document the expansion bounds 2026-06-10 04:01:16 +02:00
EUCTWPlane11.swift feat(parsing): EUC-TW (CNS 11643) decoding, closing #108 2026-06-09 17:44:22 +02:00
EUCTWPlane12.swift feat(parsing): EUC-TW (CNS 11643) decoding, closing #108 2026-06-09 17:44:22 +02:00
EUCTWPlane13.swift feat(parsing): EUC-TW (CNS 11643) decoding, closing #108 2026-06-09 17:44:22 +02:00
EUCTWPlane21.swift feat(parsing): EUC-TW (CNS 11643) decoding, closing #108 2026-06-09 17:44:22 +02:00
EUCTWPlane22.swift feat(parsing): EUC-TW (CNS 11643) decoding, closing #108 2026-06-09 17:44:22 +02:00
EUCTWPlane23.swift feat(parsing): EUC-TW (CNS 11643) decoding, closing #108 2026-06-09 17:44:22 +02:00
EUCTWTable.swift feat(parsing): EUC-TW (CNS 11643) decoding, closing #108 2026-06-09 17:44:22 +02:00
Event.swift
EventReader.swift perf(parse): split the name prefix from a scanned colon offset (#292) 2026-06-25 12:23:53 +02:00
EventReaderAttributes.swift perf(parsing): skip reference decoding for ampersand-free attribute values (#278) 2026-06-25 00:17:31 +02:00
EventReaderContent.swift perf(parsing): dispatch element-content markup on the byte after '<' (#276) 2026-06-24 19:25:10 +02:00
EventReaderEndTag.swift feat(xpath,parsing): public streaming surface, linear document-order at scale 2026-06-11 06:06:31 +02:00
EventReaderRecovery.swift feat(parsing): fourth W3C-suite strictness pass, declaration grammar 2026-06-10 05:34:11 +02:00
EventReaderValidity.swift perf(parse): bulk-copy literal runs in the entity decoder (#291) 2026-06-25 11:45:02 +02:00
ExternalID.swift feat(parsing): per-entity base-URI tracking for nested external entities 2026-06-10 08:24:17 +02:00
GB18030Decoder.swift refactor(parsing): drop slice copies; document the expansion bounds 2026-06-10 04:01:16 +02:00
GB18030Ranges.swift feat(parsing): full GB18030 four-byte sequences 2026-06-09 08:24:00 +02:00
GBKDecoder.swift feat(parsing): GBK/GB2312 decoding completes the CJK encodings (#99) 2026-06-09 08:08:52 +02:00
GBKTable1.swift feat(parsing): GBK/GB2312 decoding completes the CJK encodings (#99) 2026-06-09 08:08:52 +02:00
GBKTable2.swift feat(parsing): GBK/GB2312 decoding completes the CJK encodings (#99) 2026-06-09 08:08:52 +02:00
GBKTable3.swift feat(parsing): GBK/GB2312 decoding completes the CJK encodings (#99) 2026-06-09 08:08:52 +02:00
GBKTable4.swift feat(parsing): GBK/GB2312 decoding completes the CJK encodings (#99) 2026-06-09 08:08:52 +02:00
GBKTable5.swift feat(parsing): GBK/GB2312 decoding completes the CJK encodings (#99) 2026-06-09 08:08:52 +02:00
GBKTable6.swift feat(parsing): GBK/GB2312 decoding completes the CJK encodings (#99) 2026-06-09 08:08:52 +02:00
InputEncoding.swift docs: align stale figures with code and the enforced XSTS gate 2026-06-19 23:32:04 +02:00
ISO2022JPDecoder.swift refactor(parsing): drop slice copies; document the expansion bounds 2026-06-10 04:01:16 +02:00
JIS0208Table1.swift
JIS0208Table2.swift
JIS0208Table3.swift
JIS0212Table1.swift
JIS0212Table2.swift
Limits.swift feat(parsing): strict internal-subset profile, xmltest 185 of 186 2026-06-10 08:29:54 +02:00
Mark.swift
NamespaceContext.swift feat(parsing): Namespaces 1.0 constraint enforcement 2026-06-10 08:06:45 +02:00
ParsedDocument.swift
ParseError.swift feat(parsing): Namespaces 1.0 constraint enforcement 2026-06-10 08:06:45 +02:00
Parser.swift feat(parsing): IBM section clean, entity-declared WFC/VC split, declaration recursion 2026-06-10 07:26:50 +02:00
PseudoAttributeScanner.swift feat(parsing): fourth W3C-suite strictness pass, declaration grammar 2026-06-10 05:34:11 +02:00
PushAsync.swift
PushParser.swift
PushScanner.swift
Reader.swift perf(parse): split the name prefix from a scanned colon offset (#292) 2026-06-25 12:23:53 +02:00
ReaderByteRuns.swift perf(parsing): skip reference decoding for ampersand-free attribute values (#278) 2026-06-25 00:17:31 +02:00
ReadResult.swift
SAXHandler.swift
ShiftJISDecoder.swift
SingleByteEncodings.swift
SingleByteTables.swift
SourceRange.swift
StreamingDecoder.swift feat(parsing): EUC-TW (CNS 11643) decoding, closing #108 2026-06-09 17:44:22 +02:00
StreamingDecoderEUCTW.swift feat(parsing): EUC-TW (CNS 11643) decoding, closing #108 2026-06-09 17:44:22 +02:00
StreamingDecoderISO2022JP.swift feat(parsing): streaming honors the declared encoding; streaming ISO-2022-JP 2026-06-09 17:33:52 +02:00
TextReader.swift
UnparsedEntity.swift
ValidityFinding.swift refactor(validation): located structured validity findings 2026-06-10 10:45:17 +02:00
XMLCharacter.swift perf(parsing): byte-level scanning fast paths halve parse time vs libxml2 (#275) 2026-06-24 18:46:58 +02:00
XMLDeclaration.swift feat(parsing): strict DTD subset grammar, oasis section of xmlconf fully clean 2026-06-10 06:29:13 +02:00