You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/10/03 01:47:41 UTC

DO NOT REPLY [Bug 13225] - XPath's selectNodeList performance degrades when using Xerces as DOM.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13225>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13225

XPath's selectNodeList performance degrades when using Xerces as DOM.

David_N_Bertoni@lotus.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From David_N_Bertoni@lotus.com  2002-10-02 23:47 -------
Luckily, this is an easy fix! ;-)

Change this line:

pXalanDOMDoc = pXercesParserLiaison->createDocument( cXercesDOMDoc );

to this:

pXalanDOMDoc = pXercesParserLiaison->createDocument( cXercesDOMDoc, false, 
true );

That should fix the problem you're seeing.  The limitations:

1. You must not create the bridge until you've finished modifying the document.
2. If you modify the document, you must destroy the bridge and re-create it.

If you need the bridge to be thread-safe, the call should be:

pXalanDOMDoc = pXercesParserLiaison->createDocument( cXercesDOMDoc, true, 
true );

If the limitations will work for you, then you're all set.  Otherwise, their's 
nothing that can be done, since the time being consumed is a result of having 
to order the document on-the-fly.

Here are my results, after the fix:

V:\test\Coble>Release\XalanExe //Keyword fast_result.xml
Xalan Results: 130 milliseconds to parse the file.
               30 milliseconds to perform the search.
               6546 items were returned.

Xerces Results: 191 milliseconds to parse the file.
                50 milliseconds to perform the search.
                6546 items were returned.

Benchmarking complete:  Xalan DOM beat Xerces DOM by 20 milliseconds.

V:\test\Coble>Release\XalanExe //Keyword slow_results.xml
Xalan Results: 70 milliseconds to parse the file.
               10 milliseconds to perform the search.
               1922 items were returned.

Xerces Results: 100 milliseconds to parse the file.
                30 milliseconds to perform the search.
                1922 items were returned.

Benchmarking complete:  Xalan DOM beat Xerces DOM by 20 milliseconds.