XmlSearch Performance issues

Description

XmlSearch is slow on Lucee 5.2.9.31 (and also has performance issues on Lucee 4.5, just not as bad).

This is a problem with Xalan described here:

https://blog.jooq.org/2013/08/25/how-to-speed-up-apache-xalans-xpath-processor-by-factor-10x/
https://issues.apache.org/jira/browse/XALANJ-2540

The workaround suggested is to add Java arg:

1 -Dorg.apache.xml.dtm.DTMManager=org.apache.xml.dtm.ref.DTMManagerDefault

Test case

I ran the following code on both latest 4.5 and 5.2.9.31 and got the load times reported below:

1 2 3 4 5 6 7 8 9 start = getTickCount(); myXml = XmlParse( '<?xml version="1.0" encoding="UTF-8"?> <some> <xml> <here>Content</here> </xml> </some>' ); for( i=1; i<= 10000; i++ ) { XmlSearch( myXml, "/some/xml/here" ); } end = getTickCount(); echo( end-start );

Load times for Lucee 4.5

  • Without arg: ~600ms

  • With arg: ~190ms

Load times for Lucee 5

  • Without arg: ~8000ms

  • With arg: ~190ms

Environment

None

Status

Assignee

Michael Offner

Reporter

Dominic Watson

Labels

Sprint

None

Fix versions

Affects versions

5.2.9.31

Priority

Blocker