pgsql: doc: Speed up XSLT builds

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: doc: Speed up XSLT builds
Date: 2016-08-18 17:55:39
Message-ID: E1baRXX-0000KJ-C7@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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(dot)lakhin(at)postgrespro(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-08-18 18:49:18 pgsql: In plpgsql, don't try to convert int2vector or oidvector to expa
Previous Message Tom Lane 2016-08-18 15:29:19 pgsql: Improve psql's tab completion for \l.