Memory footprint work: what a tree holds and what a transform peaks at. Output
is byte-identical; new API is additive.
Added
| Change |
What it does |
Commit |
| Streamed aggregates over records |
A lone value-of/copy-of/sequence over one record path streams too; count/sum/min/max fold per record: 1 GB summed in 33 MB RSS. Any error re-runs on the tree. |
457aa03, 9f3d815, 48b1a38, 3157566, 4944511 |
Streamed xsl:source-document, first stage |
A streamable xsl:for-each/xsl:iterate over a child path reads one record at a time: 1 GB totalled at 27 MB RSS, not 3.7 GB, at about 2× CPU. Other shapes build the tree. |
3f185fe, 27757b3 |
xdm.ParseBursts |
Parses a document handing over one selected element at a time in a tree of its own, with limits counted over the whole document; memory stays at the spine plus one record. |
b4b6052, 80f999f |
xslt.FileResolver.MaxNodes; MaxBytes reaches the parser |
Raising MaxBytes past 64 MB had no effect on fn:doc, the parser kept its own default. Both limits now apply to what the resolver parses. |
80f999f |
xdmbuild.InPlaceDocument |
A builder rooted at a new document node, for content built straight into it. |
302c932 |
Changed — streamability analysis
| Change |
Problem → solution |
Commit |
| Six constructs escaped the §19.8 check and compiled |
A nested xsl:map-entry, extension instructions (their xsl:fallback), xsl:result-document serialization AVTs, boolean pattern predicates, mode="#all" rules and rule xsl:param defaults are now judged: such stylesheets get XTSE3430. |
b5703be, 8c391d8, ff0ed5e, ca1b029, 268acce, 7920635 |
| A verdict could rest on a declaration nobody checked |
Verdicts carry an unverified bit for streamable functions, attribute sets, accumulators, modes and other modules; streamed execution requires it clear. No refusal changes. |
b12ecbf, e94cdf9 |
Changed — memory
| Change |
Problem → solution |
Commit |
| Namespace nodes lived as long as their tree |
//namespace::* on 5 MiB kept 140 MB. They are held weakly, 16 to a chunk, and freed when nothing holds them: under 0.5 MB after the query. |
ac4973e, fcab85a, e1b5e1f |
| Built-in shallow-copy built a document result twice |
In a mode with no template rules it builds in place: parse-100mb identity peak 1091 → 930 MB, CPU −25 to −40%. |
302c932 |
| Built trees stored every whitespace-only text value |
They share one value per string, as a parse does: an identity result is the size of its source again. |
c60f8f3, 09f0c5d |
| A deep copy duplicated the source's text |
xsl:copy-of of 4,096+ records borrows the source blocks it fills by half or more: XMark identity result −28%, peak −19%. |
546af03, b4cd614 |
Every copy-of was kept until the transform ended |
Each copied node was recorded against its original for accumulators, even with none declared: a 10 MB stream copying each record peaked at 830 MB. The table exists only when an accumulator does: 2.8 MB. Also in v2.1.1. |
c7952b0 |
| Full record chunks were padded 6% by the malloc header |
They are allocated two at a time past the 8th, 40,960 B exactly: parse-100mb retained 370 → 350.5 MB. |
907c674 |