[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Please test 1.69.0 if you haven't already
Doug du Boulay <ddb@owari.msl.titech.ac.jp> writes:
> On Tuesday 09 August 2005 19:44, Michael Smith wrote:
> > If you haven't already, please download either the docbook-xsl
> > 1.69.0 release or the current snapshot and run your docs through
> > it to see if you find any new problems (that is, problems that you
> > didn't find in the 1.68.1 release or previous releases).
>
> Not so much a problem, but seemingly running a little slow.
> I have to admit that I am applying some significant customizations to the html
> templates (tabular-toc) and chunking a 2.8Mb file.
>
> using xsltproc --profile I got
>
> number match name mode Calls Tot 100us Avg
>
> 0 apply-annotations 16987 179749635 10581
[...]
> The point of which was that apply-annotations seems to be chewing up
> about 75% of processing time
Yipes. That is definitely excessive.
> and if there was any way to make it more efficient, or a
> parameter to switch off the inessential bits somehow???
I just looked at the code. Here's what I found: When the
apply-annotations template is called, it searches through the
entire document instance, from the root, looking for Annotation
elements. See line 27 of the html/annotations.xsl file -
<xsl:template name="apply-annotations">
<!-- do any annotations apply to the context node? -->
<xsl:variable name="id" select="(@id|@xml:id)[1]"/>
<xsl:variable name="aids">
<xsl:for-each select="//annotation">
That search would take up hardly any time at all if
apply-annotations were being called only once. But it is actually
being called for every single instance of an inline element.
The purpose of the search is to populate a template-local variable
with a list of the values of the IDs for each Annotation in the
document. As far as I can see, it doesn't need to be doing
populating that variable every single time it finds an Annotation.
I think it should instead just use xsl:key or a global variable
that is populates just once per document.
I could change it myself, but it's a feature that Norm added just
last month. So I wouldn't want to change it without discussing it
with him. And I reckon he would probably prefer to change it
himself. But I think he's on vacation right now...
Anyway, I don't know whether we should wait for the change to be
made before we release 1.69.1. I guess we probably should. I will
ask the other developers on the project and see what they think.
--Mike
--
Michael Smith
http://sideshowbarker.net/
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]