You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Pavel Ausianik <Pa...@epam.com> on 2002/11/20 13:46:59 UTC

Defer node expansion

Hello,

Sorry, I'm trying to send this messages for 3 times, but it somehow do not
appears in the list on marc server, most probably list does not accept mail
from those who not subscribed. 
  
Could somebody explain when the defer node expansion should be used in
xerces 2?

In my project I have found that DOM Parsing for via DocumentBuilder.parse
for documents around 5K is 20% faster is I turn off defer node expansion by
setting factory attribute
"http://apache.org/xml/features/dom/defer-node-expansion" to Boolean.FALSE.

The xerces version is one included with xalan 2.4.0 ( built on 08/27/2002).


The docs on apache site is very short

DOM Features  
     
http://apache.org/xml/features/dom/defer-node-expansion  
   
 
  True:   Lazily expand the DOM nodes.    
False:   Fully expand the DOM nodes.    
Default:   true**   
Note:   In the DOMBuilder implementation the default value of this feature
is false.    
Note:   When this feature is set to true, the DOM nodes in the returned
document are expanded as the tree is traversed. This allows the parser to
return a document faster than if the tree is fully expanded during parsing
and improves memory usage when the whole tree is not traversed.    
 
 
Is there some statistics available when and how much performance difference
exists between this option on /off.

Thanks in advance,
Pavel






---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Defer node expansion

Posted by Joseph Kesselman <ke...@us.ibm.com>.
On Wednesday, 11/20/2002 at 02:46 ZE2, Pavel Ausianik 
<Pa...@epam.com> wrote:
> Could somebody explain when the defer node expansion should be used in
> xerces 2?

1) When you don't intend to examine the entire document, this choice can 
save memory and parsing time.

2) When latency (time before you can access the first node) is more 
important than throughput (time before you can access the last node), this 
choice can make your program more responsive.

Hence, deferred node expansion tends to be particularly helpful when 
processing only part of a large document. But it may cost performance when 
processing all of a small document. That's why it's optional.


(Note the similarity to  Xalan's "incremental DTM" mode.)

______________________________________
Joe Kesselman  / IBM Research

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org