This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
(more) XSL processing time: xsl:number level="any"
- From: Jens Emmerich <Jens dot Emmerich at encorus dot com>
- To: docbook-apps at lists dot oasis-open dot org
- Date: Mon, 22 Jul 2002 15:54:29 +0200
- Subject: DOCBOOK-APPS: (more) XSL processing time: xsl:number level="any"
Hi all,
I had to experiment with xsltproc --timing --profile as well. We have
documents with many nodes (tables and much inline markup), of several
hundred pages in printed output with many small sections.
When turning on auto-labelling, the template producing the chapter-
(likewise appendix-) labels is extremly "expensive". Replacing the
original one with the following:
<xsl:template match="chapter" mode="label.markup">
<xsl:choose>
<xsl:when test="@label">
<xsl:value-of select="@label"/>
</xsl:when>
<xsl:when test="$chapter.autolabel != 0">
<xsl:choose>
<xsl:when test="$label.from.part != 0 and ancestor::part">
<xsl:number from="part" format="1" level="single"/>
</xsl:when>
<xsl:when test="parent::book and count(../part) = 0">
<xsl:number from="book" format="1" level="single"/>
</xsl:when>
<xsl:otherwise>
<xsl:number from="book" format="1" level="any"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
(likewise for appendix) yields a five-times improvement in processing
speed (25 minutes -> 5 minutes) using xsltproc when not using any
"part". This is due to avoiding level="any".
The problem is that <xsl:number from="book" format="1" level="any"/>
take quite a long time. For a single footnote, e.g., it amounts to 4s
of processing time (PIII 650MHz, enaugh memory), two seconds for each
call (producing the label and the reference).
Is there any better way (keys?) for footnotes than to turn them into
"note"s?
Jens
Btw., similar results were obtained when using saxon, so
level="any" seems to be a hot spot independently of xsltproc.