[xslt] Performance issue


Sorry for the very vague subject…

We are facing a performance issue on a processing using Python lxml.

The legacy, running on CentOS 7, with lxml 4.3.4 / libxml 2.9.1 / libxslt 1.1.28 works fine (5'' to 10’’ in biggest use-case)

We are deploying this process to CentOS 8 Stream, which bumped our libs to lxml 4.7.1 / libxml 2.9.7 / libxslt 1.1.32.

And then, our Python processing time increased by a x20 factor.

After digging further, we pinned the performance issue to be in libxslt, by comparing the time taken by xsltproc for the same xml and xslt files on CentOS 7 and CentOS 8 Stream.

The xslt used is at the end of this message.

I’m not an expert of XSL, but is there any chance that this would be linked to https://gitlab.gnome.org/GNOME/libxslt/-/issues/24 and https://bugzilla.gnome.org/show_bug.cgi?id=777432 (fixed after 1.1.28)?

Best regards


The XSL used:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" encoding="UTF-8"/>
  <xsl:param name="indent-increment" select="'  '"/>

  <xsl:template name="newline">
    <xsl:text disable-output-escaping="yes">

  <xsl:template match="comment() | processing-instruction()">
    <xsl:param name="indent" select="''"/>
    <xsl:call-template name="newline"/>
    <xsl:value-of select="$indent"/>
    <xsl:copy />

  <xsl:template match="text()">
    <xsl:param name="indent" select="''"/>
    <xsl:call-template name="newline"/>
    <xsl:value-of select="$indent"/>
    <xsl:value-of select="normalize-space(.)"/>

  <xsl:template match="text()[normalize-space(.)='']"/>

  <xsl:template match="*">
    <xsl:param name="indent" select="''"/>
    <xsl:call-template name="newline"/>
    <xsl:value-of select="$indent"/>
       <xsl:when test="count(child::*) > 0">
         <xsl:copy-of select="@*"/>
         <xsl:apply-templates select="*|text()">
           <xsl:with-param name="indent" select="concat ($indent, $indent-increment)"/>
         <xsl:call-template name="newline"/>
         <xsl:value-of select="$indent"/>
        <xsl:copy-of select="."/>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]