You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ax...@ws.apache.org on 2004/10/15 20:09:53 UTC

[jira] Closed: (AXIS-942) addTextNode() and getValue() extremely slow when Xerces is used as the XML parser

Message:

   The following issue has been closed.

   Resolver: Davanum Srinivas
       Date: Fri, 15 Oct 2004 11:09 AM

We are now caching DocumentBuilder's and using shared Document's. Please try latest CVS and report problems if any.

-- dims
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-942

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-942
    Summary: addTextNode() and getValue() extremely slow when Xerces is used as the XML parser
       Type: Bug

     Status: Closed
 Resolution: FIXED

    Project: Axis
 Components: 
             Basic Architecture
   Versions:
             1.1rc2

   Assignee: 
   Reporter: Jin Siong Voon

    Created: Fri, 4 Jul 2003 1:35 AM
    Updated: Fri, 15 Oct 2004 11:09 AM
Environment: Operating System: Windows XP
Platform: PC

Description:
Hi,

I am using reading and writing SOAP messages using the Axis API and found that 
if I've set Xerces (2.4.0) as my XML parser, these calls consume a LOT of time.

1) addTextNode() method in the org.apache.axis.message.MessageElement class is 
very slow.  Did more digging, and the problem code is in the 
org.apache.axis.message.Text class where it creates a new org.w3c.dom.Document 
(and DocumentBuilder) every single time addTextNode() is called.  For some 
reason, creating a new Document and DocumentBuilder in Xerces is slower 
compared to Crimson (Crimson is the default for Sun JDK1.4.x), and without 
caching of some sort, this just make the whole exercise of adding text node to 
an element unacceptably slow.  Tried it with Crimson as the parser, and it was 
very fast!

2) getValue() method in the org.apache.axis.message.MessageElement class is 
very slow.  This problem is very similar to the one in (1) above, in the sense 
that a new Document (and hence DocumentBuilder) is created each time getValue
() is called.  The problem code is in getAsDocument() in MessageElement.  
Again, tried it with Crimson, and it was very fast!

Xerces has somehow put more penalty for creating DocumentBuilder and Document, 
so Axis might want to think of caching them for reuse and speed up things.  
This bug is quite critical, as it really slows down our application, and we 
have to put a pretty ugly hack to get around it (and yes, we have to use 
Xerces 2.4 onwards for our application).


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira