VirtualBox

Ignore:
Timestamp:
Jan 22, 2015 1:53:43 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
97788
Message:

apiwrap-server.xsl: Work around stupid xsltproc performance issue when outputting large 'text' format documents. Force it to split up the output buffer every so often.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/apiwrap-server.xsl

    r53913 r53915  
    4343
    4444<!-- - - - - - - - - - - - - - - - - - - - - - -
    45   keys for more efficiently looking up types.
     45  Keys for more efficiently looking up types.
    4646 - - - - - - - - - - - - - - - - - - - - - - -->
    4747
     
    4949<xsl:key name="G_keyInterfacesByName" match="//interface[@name]" use="@name"/>
    5050
     51
     52<!-- - - - - - - - - - - - - - - - - - - - - - -
     53  Utility templates.
     54 - - - - - - - - - - - - - - - - - - - - - - -->
     55
     56<!-- Hack Alert! This template helps xsltproc split up the output text elements
     57                 and avoid reallocating them into the MB range. Calls to this
     58                 template is made occationally while generating larger output
     59                 file.  It's not necessary for small stuff like header.
     60
     61                 The trick we're playing on xsltproc has to do with CDATA
     62                 and/or the escape setting of the xsl:text element.  It forces
     63                 xsltproc to allocate a new output element, thus preventing
     64                 things from growing out of proportions and slowing us down.
     65
     66                 This was successfully employed to reduce a 18+ seconds run to
     67                 around one second (possibly less due to kmk overhead).
     68 -->
     69<xsl:template name="xsltprocNewlineOutputHack">
     70    <xsl:text disable-output-escaping="yes"><![CDATA[
     71]]></xsl:text>
     72</xsl:template>
    5173
    5274<!-- - - - - - - - - - - - - - - - - - - - - - -
     
    5779    <xsl:param name="file"/>
    5880
     81    <xsl:call-template name="xsltprocNewlineOutputHack"/>
    5982    <xsl:value-of select="concat($G_sNewLine, '// ##### BEGINFILE &quot;', $file, '&quot;', $G_sNewLine)"/>
    6083</xsl:template>
     
    13181341</xsl:text>
    13191342    <xsl:if test="not(@readonly) or @readonly!='yes'">
    1320     <xsl:text>
     1343        <xsl:text>
    13211344</xsl:text>
    13221345        <xsl:value-of select="concat('STDMETHODIMP ', $topclass, 'Wrap::COMSETTER(', $attrbasename, ')(')"/>
     
    14301453    </xsl:call-template>
    14311454
    1432     <xsl:text>
    1433 </xsl:text>
     1455    <xsl:call-template name="xsltprocNewlineOutputHack"/>
    14341456</xsl:template>
    14351457
     
    23062328
    23072329    <!-- methods -->
     2330    <xsl:call-template name="xsltprocNewlineOutputHack"/>
    23082331    <xsl:call-template name="emitMethods">
    23092332        <xsl:with-param name="topclass" select="$topclass"/>
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette