Skip to content

Commit 32d959b

Browse files
peteredmpgpro
authored andcommitted
doc: Further XSLT HTML build performance optimization
Cut out some expensive stuff from the HTML head element that we don't really need. This was previously discussed as part of e830674, but ended up separate because it changes the output contents slightly.
1 parent b8775ea commit 32d959b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

doc/src/sgml/stylesheet-speedup-xhtml.xsl

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,4 +251,45 @@
251251
</xsl:call-template>
252252
</xsl:template>
253253

254+
<xsl:template name="html.head">
255+
<xsl:param name="prev" select="/foo"/>
256+
<xsl:param name="next" select="/foo"/>
257+
258+
<!-- Optimization for pgsql-docs: Cut out a bunch of things we don't need
259+
here, including an expensive //legalnotice search. -->
260+
261+
<head>
262+
<xsl:call-template name="system.head.content"/>
263+
<xsl:call-template name="head.content"/>
264+
265+
<xsl:if test="$prev">
266+
<link rel="prev">
267+
<xsl:attribute name="href">
268+
<xsl:call-template name="href.target">
269+
<xsl:with-param name="object" select="$prev"/>
270+
</xsl:call-template>
271+
</xsl:attribute>
272+
<xsl:attribute name="title">
273+
<xsl:apply-templates select="$prev" mode="object.title.markup.textonly"/>
274+
</xsl:attribute>
275+
</link>
276+
</xsl:if>
277+
278+
<xsl:if test="$next">
279+
<link rel="next">
280+
<xsl:attribute name="href">
281+
<xsl:call-template name="href.target">
282+
<xsl:with-param name="object" select="$next"/>
283+
</xsl:call-template>
284+
</xsl:attribute>
285+
<xsl:attribute name="title">
286+
<xsl:apply-templates select="$next" mode="object.title.markup.textonly"/>
287+
</xsl:attribute>
288+
</link>
289+
</xsl:if>
290+
291+
<xsl:call-template name="user.head.content"/>
292+
</head>
293+
</xsl:template>
294+
254295
</xsl:stylesheet>

0 commit comments

Comments
 (0)