[gtk-doc] xslt: performance improvements
- From: Stefan Kost <stefkost src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk-doc] xslt: performance improvements
- Date: Wed, 23 Dec 2009 00:36:33 +0000 (UTC)
commit 5ea903fe7eed24de99d88464933163b092ed1bd1
Author: Stefan Kost <ensonic users sf net>
Date: Wed Dec 23 02:35:10 2009 +0200
xslt: performance improvements
API docs are english anyway. Hardcode the language to get a 20% speedup. Update
TODO.
TODO | 6 +++++-
gtk-doc.xsl | 26 ++++++++++++++++++++++----
2 files changed, 27 insertions(+), 5 deletions(-)
---
diff --git a/TODO b/TODO
index 47622bf..e646ed5 100644
--- a/TODO
+++ b/TODO
@@ -385,7 +385,7 @@ grep "gst_caps_is_always_compatible" tags
- xslt
http://docbook2x.sourceforge.net/latest/doc/performance.html
- play with xsltproc --profile --verbose --timing
- cd tests/gobject/docs
+ cd tests/gobject/docs/html
time /usr/bin/xsltproc 2>xslt.log --profile --verbose --timing --path /home/ensonic/projects/gnome/gtk-doc/gtk-doc/tests/gobject/docs --nonet --xinclude --stringparam gtkdoc.bookname tester --stringparam gtkdoc.version 1.14 /home/ensonic/projects/gnome/gtk-doc/gtk-doc/gtk-doc.xsl ../tester-docs.xml
- l10n.language is slow
bug: https://sourceforge.net/tracker/index.php?func=detail&aid=2918673&group_id=21935&atid=373750
@@ -396,6 +396,7 @@ grep "gst_caps_is_always_compatible" tags
2m15.221s 1m58.740s 0m1.456s
>
1m55.480s 1m44.296s 0m2.125s
+ - removing the gentext calls for nav-bar alt tags does not help
- try plain docbook xslt to see if maybe we have bad xslt templates in the
@@ -434,4 +435,7 @@ grep "gst_caps_is_always_compatible" tags
- we could also try to compact the installed xslt
xmllint --nonet --c14n --xinclude gtk-doc.xsl | sed -ne '/<!--/ { :c; /-->/! { N; b c; }; /-->/s/<!--.*-->//g }; /^ *$/!p;' | sed '/^$/d' >gtk-doc.pre.xsl
+ - unfortunately there is no way to ask xsltproc to pre-transform an xslt, that could
+ - strip comments
+ - process xsl:import and xsl:include
diff --git a/gtk-doc.xsl b/gtk-doc.xsl
index 0b6b320..96c6c89 100644
--- a/gtk-doc.xsl
+++ b/gtk-doc.xsl
@@ -31,7 +31,7 @@
<xsl:param name="html.ext" select="'.html'"/>
<xsl:param name="refentry.generate.name" select="0"/>
<xsl:param name="refentry.generate.title" select="1"/>
-
+
<!-- use index filtering (if available) -->
<xsl:param name="index.on.role" select="1"/>
@@ -47,6 +47,12 @@
<xsl:param name="gtkdoc.bookname" select="''"/>
<!-- ========================================================= -->
+
+ <!-- l10n is slow, we don't ue it, so we'd like to turn it off
+ this atleast avoid the re-evaluation -->
+ <xsl:template name="l10n.language">en</xsl:template>
+
+ <!-- ========================================================= -->
<!-- template to create the index.sgml anchor index -->
<xsl:template match="book|article">
@@ -75,7 +81,7 @@ Get a newer version at http://docbook.sourceforge.net/projects/xsl/
<xsl:call-template name="write.text.chunk">
<xsl:with-param name="filename" select="'index.sgml'"/>
<xsl:with-param name="content">
- <xsl:apply-templates select="//releaseinfo/ulink"
+ <xsl:apply-templates select="/book/bookinforeleaseinfo/ulink"
mode="generate.index.mode"/>
<!-- check all anchor and refentry elements -->
<xsl:apply-templates select="//anchor|//refentry|//refsect1|//refsect2|//refsynopsisdiv|//varlistentry"
@@ -100,7 +106,7 @@ Get a newer version at http://docbook.sourceforge.net/projects/xsl/
</xsl:if>
</xsl:template>
- <xsl:template match="//releaseinfo/ulink" mode="generate.index.mode">
+ <xsl:template match="/book/bookinfo/releaseinfo/ulink" mode="generate.index.mode">
<xsl:if test="@role='online-location'">
<xsl:text><ONLINE href="</xsl:text>
<xsl:value-of select="@url"/>
@@ -503,7 +509,7 @@ Get a newer version at http://docbook.sourceforge.net/projects/xsl/
<div class="container">
<div class="gallery-spacer"> </div>
<xsl:apply-templates mode="gallery.mode"/>
- <div class="gallery-spacer"> </div>
+ <div class="gallery-spacer"> </div>
</div>
</xsl:when>
<xsl:otherwise>
@@ -511,7 +517,17 @@ Get a newer version at http://docbook.sourceforge.net/projects/xsl/
</xsl:otherwise>
</xsl:choose>
</xsl:template>
+ <!-- FIXME: try if that works too -->
+ <!--xsl:template match="para[ role='gallery']">
+ <div class="container">
+ <div class="gallery-spacer"> </div>
+ <xsl:apply-templates mode="gallery.mode"/>
+ <div class="gallery-spacer"> </div>
+ </div>
+ </xsl:template-->
+
+
<xsl:template match="link" mode="gallery.mode">
<div class="gallery-float">
<xsl:apply-templates select="."/>
@@ -597,6 +613,7 @@ Get a newer version at http://docbook.sourceforge.net/projects/xsl/
<xsl:apply-templates/>
</xsl:template>
+ <!-- this is not in use yet (see gtkdoc-mkdb
<xsl:template match="//refsect2/ulink[ role='extralinks']"/>
<xsl:template match="//refsect1/ulink[ role='extralinks']"/>
@@ -607,6 +624,7 @@ Get a newer version at http://docbook.sourceforge.net/projects/xsl/
<xsl:template match="//refsect1/title">
<h2><xsl:call-template name="user.format.extralinks"/></h2>
</xsl:template>
+ -->
<!-- ==================================================================== -->
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]