pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: doc: Speed up XSLT builds
Date: Thu, 18 Aug 2016 17:55:39 +0000
Message-ID: <E1baRXX-0000KJ-C7@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

doc: Speed up XSLT builds

The upstream XSLT stylesheets use some very general XPath expressions in
some places that end up being very slow.  We can optimize them with
knowledge about the DocBook document structure and our particular use
thereof.  For example, when counting preceding chapters to get a number
for the current chapter, we only need to count preceding sibling
nodes (more or less) instead of searching through the entire node tree
for chapter elements.

This change attacks the slowest pieces as identified by xsltproc
--profile.  This makes the HTML build roughly 10 times faster, resulting
in the new total build time being about the same as the old DSSSL-based
build.  Some of the non-HTML build targets (especially FO) will also
benefit a bit, but they have not been specifically analyzed.

With this, also remove the pg.fast parameter, which was previously a
hack to get the build to a manageable speed.

Alexander Lakhin <a.lakhin@postgrespro.ru>, with some additional
tweaking by me

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/e8306745e3504c642f7abad411139d5630e29fac

Modified Files
--------------
doc/src/sgml/stylesheet-common.xsl         |   8 +-
doc/src/sgml/stylesheet-speedup-common.xsl |  94 +++++++++++
doc/src/sgml/stylesheet-speedup-xhtml.xsl  | 252 +++++++++++++++++++++++++++++
doc/src/sgml/stylesheet.xsl                |   1 +
4 files changed, 350 insertions(+), 5 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1baRXX-0000KJ-C7@gemulon.postgresql.org>
Permalink:  ../E1baRXX-0000KJ-C7@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1baRXX-0000KJ-C7@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter_e@gmx.net
  Subject: Re: pgsql: doc: Speed up XSLT builds
  In-Reply-To: <E1baRXX-0000KJ-C7@gemulon.postgresql.org>
  References: <E1baRXX-0000KJ-C7@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox