PureXML/Sources/XSLT
Mihaela Mihaljevic e5b5120ac2
perf(xslt): direct ID lookup in id() instead of full-index scan (#315)
id() filtered the entire document ID index by tokens.contains on every
call, O(index) per call, so a stylesheet calling id() across a wide
document was quadratic. Look each requested token up directly in the
index dictionary instead, O(tokens). The result is unchanged: the same
elements, in document order (the ID values are the keys, each mapping to
one element). key() already used direct lookups.

Resolving 4000 id() references against a 4000-entry index drops from
about 0.34 s to about 0.03 s (~13x), now linear.
2026-06-26 04:25:58 +02:00
..
XSLTAVT.swift
XSLTCollation.swift
XSLTDocumentCache.swift
XSLTElements.swift perf(xslt): cache xsl:number level single/multiple sibling ranks (#310) 2026-06-26 01:13:07 +02:00
XSLTFunctions.swift fix(xslt): make key(), id(), and EXSLT set functions linear over wide fan-outs (#300) 2026-06-25 18:45:08 +02:00
XSLTGlobals.swift
XSLTLookups.swift perf(xslt): direct ID lookup in id() instead of full-index scan (#315) 2026-06-26 04:25:58 +02:00
XSLTMatchCache.swift
XSLTModel.swift
XSLTNamespaceFixup.swift
XSLTNumbering.swift perf(xslt): cache xsl:number level single/multiple sibling ranks (#310) 2026-06-26 01:13:07 +02:00
XSLTParser.swift
XSLTParserDeclarations.swift
XSLTParserEntry.swift
XSLTParserStructural.swift
XSLTRawText.swift
XSLTRuntime.swift
XSLTSorting.swift
XSLTTransform.swift
XSLTTransformer.swift perf(xslt): cache xsl:number level single/multiple sibling ranks (#310) 2026-06-26 01:13:07 +02:00
XSLTUnitCollector.swift
XSLTWhitespace.swift