Hi,

On 2023-03-19 19:33:38 -0700, Andres Freund wrote:
> I think we can make the docs build in parallel and incrementally, by building
> the different parts of the docs in parallel, using --stringparam rootid,
> e.g. building each 'part' separately.
> 
> A very very rough draft attached:
> 
> parallel with parts:
> real  0m10.831s
> user  0m58.295s
> sys   0m1.402s
> 
> normal:
> real  0m32.215s
> user  0m31.876s
> sys   0m0.328s
> 
> 1/3 of the build time at 2x the cost is nothing to sneeze at.

I could not make myself stop trying to figure out where the big constant time
factor comes from. Every invocation costs about 2s, even if not much is
rendered. Turns out, that's solely spent building all the <xsl:key>s. The
first time *any* key() is invoked for a document, all the keys are computed in
a single pass over the document.

A single reasonable key doesn't take that much time, even for the size of our
docs. But there are several redundant keys being built. Some of them somewhat
expensive. E.g. each
<xsl:key name="genid" match="*" use="generate-id()"/>
takes about 300ms. There's one in chunk-common and one in
docbook-no-doctype.xsl.

I'm going to cry now.

Greetings,

Andres Freund


Reply via email to