Re: [xsl] Seek ways to make my streaming XSLT code run faster (My streaming XSLT program has been running 12 hours and is only a quarter of the way to completion)

Subject: Re: [xsl] Seek ways to make my streaming XSLT code run faster (My streaming XSLT program has been running 12 hours and is only a quarter of the way to completion)
From: "Liam R. E. Quin liam@xxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 11 Aug 2025 03:38:52 -0000
On Sun, 2025-08-10 at 15:30 +0000, Wendell Piez wapiez@xxxxxxxxxxxxxxx
wrote:
> Hello,
>
> To restate what Liam just said, more blatantly: this is an indexing
> problem. Streaming mode is getting in the way. What Liam is
> suggesting is a two-step solution where streaming is used to create a
> document efficiently that is more efficient to index, and to index
> that document. (Right, Liam?)

Well, no, but that works too.

I was thinking this could be solved in a single pass without any
explicit loops, just using templates. The question was,
I want to find all <record> elements
B  whose child is not an <Airport_SID_Primary_Records> element
B  B and whose child element contains an identifier element with value
"ABC ."B 


Without streaming, you can
(1) read the auxilliary Identifiers file into a map, such that
B  B  $identifiers("ABC ") exists if and only if "ABC " is in the
Identifiers file.

(2) process each record in turn, and see if it has an identifier that's
in the map
B  B  <xsl:if test="$identifiers{VOR_Identifier} = 1">
B  B  B  then we want this record
B  (having already eliminated the ones with SID_Identifier in the match
pattern.

Since map access is likely somewhere between O(1) and O(log n), this
should be fast.

liam


--
Liam Quin,B https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations: B http://www.fromoldbooks.org

Current Thread