eXist-db / exist

eXist Native XML Database and Application Platform
https://exist-db.org
GNU Lesser General Public License v2.1
430 stars 180 forks source link

transform:transform progressively slower each run for external xsl #2343

Closed ahenket closed 5 years ago

ahenket commented 5 years ago

When you run an xquery with a transform:transform() it becomes progressively slower each time you run it, gaining almost a second each run. This only happens when the xsl file is called through http. I could not reproduce when the xsl is in the same exist-db instance.

I've not seen this behavior in eXist-db 4.4.0 so to the best of my knowledge this is regression for version 4.5.0. Tested using local instance of eXist-db 4.5.0, macOS 10.14.2.

Reproduction code:

let $xsl    := xs:anyURI('http://art-decor.org/ADAR/rv/ValueSet2html.xsl')
let $params := 
<parameters>
    <param name="projectDefaultLanguage"      value="nl-NL"/>
    <param name="artdecordeeplinkprefix"      value="http://deeplink/"/>
    <param name="seeThisUrlLocation"          value="http://seeme/"/>
    <param name="displayHeader"               value="true"/>
    <param name="rand"                        value="128"/>
    <param name="logLevel"                    value="'OFF'"/>
    <param name="bindingBehaviorValueSetsURL" value="http://binding/"/>
    <param name="switchCreateTreeTableHtml"   value="true"/>
</parameters>
let $xml    :=
<decor repository="true">
    <project id="1.2.3" prefix="test-" experimental="false" defaultLanguage="nl-NL"/>
    <terminology>
        <result>
            <project ident="test-">
                <valueSet id="1.3.2" name="TestValueSet" displayName="TestValueSet" effectiveDate="2018-07-24T13:03:43" statusCode="draft">
                    <sourceCodeSystem id="2.16.840.1.113883.6.9999" identifierName="TestSystem" canonicalUri="urn:oid:2.16.840.1.113883.6.9999"/>
                    <publishingAuthority name="ART-DECOR"/>
                    <copyright language="en-US">Very Important Copyright Notice</copyright>
                    <conceptList>
                        <concept code="30807003" codeSystem="2.16.840.1.113883.6.9999" codeSystemName="TestSystem" displayName="Benigne" level="0" type="L"/>
                        <concept code="21594007" codeSystem="2.16.840.1.113883.6.9999" codeSystemName="TestSystem" displayName="Maligne" level="0" type="L"/>
                    </conceptList>
                </valueSet>
            </project>
        </result>
    </terminology>
</decor>

return
    <html><head><title/></head><body>{transform:transform($xml, $xsl, $params)}</body></html>
dizzzz commented 5 years ago

As the transform functions havent been touched recently, and the loading of the external resource entirely depends on an external http server.... hmmmmm @adamretter maybe a resource leak in the file cache handling or so....

ahenket commented 5 years ago

I've been trying to reproduce this, and me nor my colleagues could. So best to close this and reopen if it reproduces reliably.