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/01 23:58:32 UTC

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

The following comment has been added to this issue:

     Author: Pablo Kang
    Created: Fri, 1 Oct 2004 2:57 PM
       Body:
Yes, please post patch or vote to have this fixed. We just ran into this issue while running performance tests. In our app, profiling data indicates that 70% of the time is spent in org.apache.axis.utils.XMLUtils.newDocument (entry point is getValue()).


---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/AXIS-942?page=comments#action_53601

---------------------------------------------------------------------
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: Open

    Project: Axis
 Components: 
             Basic Architecture
   Versions:
             1.1rc2

   Assignee: Axis Developers Mailing List
   Reporter: Jin Siong Voon

    Created: Fri, 4 Jul 2003 1:35 AM
    Updated: Fri, 1 Oct 2004 2:57 PM
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