Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJ529-0003cr-40 for pgsql-docs@arkaria.postgresql.org; Sun, 26 Nov 2017 22:04:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJ528-0003o7-7h for pgsql-docs@arkaria.postgresql.org; Sun, 26 Nov 2017 22:04:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eJ527-0003nx-V2 for pgsql-docs@lists.postgresql.org; Sun, 26 Nov 2017 22:04:16 +0000 Received: from mail-wr0-x22e.google.com ([2a00:1450:400c:c0c::22e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eJ522-0000gl-DB for pgsql-docs@postgresql.org; Sun, 26 Nov 2017 22:04:15 +0000 Received: by mail-wr0-x22e.google.com with SMTP id k61so24678184wrc.4 for ; Sun, 26 Nov 2017 14:04:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=unSQ+BAKprkJDEOBbcr6UOUO7XyVOLDWIuG+Luzwp68=; b=DuX68spwovfCOOBrrpEpifvkJZIM7V2n2mipx9/rGvtmYBr7NlLns6yoP8qiYUpxZr /ku6YOo6CZctQPxoOvilVXpF5FiPMJMnJ3ZZvz3Y+1/MaKfRsO7gUPfRgQt47rjbpA21 TfqfJH7fN/ae6MuVC4hHGpvaP2g9zWk7Udfffkvrg8qV/yLZR+/NK8TDgkxe9nyuEQu6 wf5h/2ZbL/vNhaIaQIBwq4GfD5cXIMhyXkd1Hk5IPR3U8ZswTVHRb9SuEGkOPzdu1mHG HU1f3NgdHLE31eimzhscrmBX6vMpCHa45R79tpem4mP4j6/asfxr+vZnDjUglAcqmCWV HBig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=unSQ+BAKprkJDEOBbcr6UOUO7XyVOLDWIuG+Luzwp68=; b=Y3yTLeU7NGMLK1yywc9QyklQoM5uq90q/3nJPxZzMrUbgwFccf0M8huKUU2sQN7HBQ /14zPwvAHA2msoS8LckUNFURHqaBkJeRXUJJ1hxWjCCQOumKWRTkVF+ms49+qxsWwLdx /hQc3U5ltEE/+RDX6s5YmgetfCXTmnZoIVr8bsFaefGVCHQ5aJFYpyx2Qo9Kh6IA1qEJ f+bhGravWhypQ/dgk38bmOoNFEeWrFmGU1JoTdq/sgM1M2uJHvocJKxI+oNRHdfRJFiO P5kDfykbiSO3fFVUrLCsRubLmE33VN9IS1GsZytRwv45mCDYiFu3xoGdCAPuoMdvSIgt 3zlA== X-Gm-Message-State: AJaThX6c+a6DoNUoTImkSKO7QCMoHWIoP+V84dqjNvZCE/P3H27+H5RT 4Rjxrc+qBGpGdYoUUNMTnoN9+C2fRDYe/JSUihrF0w== X-Google-Smtp-Source: AGs4zMYbLTB44u7KOKMjsBYGoatZbsE813/B12V391XTI7BG76NTS+X6tSVBu5JgqXOSD6Okai/XmIQ4nYGvBktDf1k= X-Received: by 10.223.186.81 with SMTP id t17mr16115944wrg.275.1511733847713; Sun, 26 Nov 2017 14:04:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.164.205 with HTTP; Sun, 26 Nov 2017 14:03:27 -0800 (PST) In-Reply-To: <877.1511623314@sss.pgh.pa.us> References: <6c7f286d-8803-3884-0638-10f513498464@gmail.com> <877.1511623314@sss.pgh.pa.us> From: Thomas Munro Date: Mon, 27 Nov 2017 11:03:27 +1300 Message-ID: Subject: Re: MacPorts xsltproc is very slow? To: Tom Lane Cc: Alexander Lakhin , pgsql-docs@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Nov 26, 2017 at 4:21 AM, Tom Lane wrote: > Thomas Munro writes: >> ... I couldn't help noticing that >> templates with match="chapter" and match="appendix" appear in our tree >> in sgml/stylesheet-speedup-common.xsl with a comment >> "Performance-optimized versions of some upstream templates from >> common/ directory". Could it be that whatever performance-enhancing >> trick they perform doesn't work on 1.1.32, or alternatively they are >> not being reached so we're falling back to non-optimised versions >> instead of these? > > If you're suspicious of that, you could try removing those parts of > stylesheet-speedup-common.xsl and see what happens ... Good idea. Removing them didn't help (though removing them makes Apple xsltproc similarly slow). Adding "d:" namespace to "chapter" and "appendix", declared in the xsl:stylesheet element as xmlns:d="http://docbook.org/ns/docbook" didn't help either. I suspect that could be made to work with some more tweaking, but I lack the XSL knowledge. I found another way forward though: On Sun, Nov 26, 2017 at 4:09 AM, Alexander Lakhin wrote: > It seems that your package is built from "ns" version. > (I couldn't find docbook-xsl-nons in Macports.) > If it's the only available version for Mac, it seems we need to adjust our > XSL templates to work with namespaces too. Aha, you're right! MacPorts does actually have two different ports (packages): docbook-xsl and docbook-xsl-ns, and the first one should be the no-namespace variant. But I can clearly see that the docbook-xsl packages installs stylesheets *with* namespaces. I compared this with a Debian system and found that common/labels.xsl (the file that defines the templates that our stylesheet-speedup-common.xsl seems to want to replace) has the "d:" prefix on "chapter" and "appendix", but doesn't on the Debian system. Presumably this interferes with the interposing technique. Perhaps that is a packaging error that should be reported upstream. That got me wondering... why does the Apple xsltproc in /usr/bin work then? Where is it even getting docbook-xsl from? I ran it with --profile and http://docbook.sourceforge.net instead of file:// URLs, and I could see outgoing connections with netstat. It believe that's because it doesn't find it locally in /etc/xml/catalog, whereas the MacPorts xsltproc looks in /opt/locl/etc/xml/catalog where it has been listed by the docbook-xsl package. So one solution is simply to uninstall the docbook-xsl package. That gets me back to fast documentation builds! Incidentally, uninstalling the docbooks-xsl package also works for FreeBSD which currently ships a too-old DocBook version. I believed until now that it couldn't build the PostgreSQL docs, so I'm very happy to discover that it can, but (1) it needs the network (2) it's using HTTP instead of HTTPS so Alice could mess with Bob's documentation. Thanks both for your help figuring this out. That's quite enough XML for one day. -- Thomas Munro http://www.enterprisedb.com