The flow of data is the following:

The parser used is our own parser that builds a compact 
representation of the source XML and then fires up events (in a SAX 
like manner but simplified) to event sinks. We have two such sinks 
implementations:

1. SAX adapter (i.e. an implementation of XMLReader) that is used as 
the SAXSource. In this scenario we transform the internal stream 
directly, i.e. without an intermediate step.

2. DOM builder that uses the events to create the document. The 
document is passed as a DOMSource to the transformation.

The time difference I mentioned does NOT include the parsing process, 
only the actual time spent on the transformation. In the DOM scenario 
we DO include the time it takes to build the DOM document (which is 
actually negligible).

I think the difference arises from the rather large number of tags  
and the text nodes they contain. I'm not familiar with the internal 
implementation (so pardon me if I'm totally off) but I would assume 
the DOMSource uses iteration to create the DTM while the SAXSource 
naturally depends on callbacks. 


Cheers,
Shmul

 
On 3 Mar 2004 at 11:04, Joseph Kesselman wrote:

> 
> 
> 
> 
> On Wednesday, 03/03/2004 at 03:12 ZE2, [EMAIL PROTECTED] wrote:
> > We have recently changed our usage of Xalan from supplying a
> > DOMSource to SAXSource. Our performance tests show some improvement
> > (10% or so) for XMLs that are around 40K in size (a couple of
> > hundreds of tags and attributes) , but for a large XML (1.3MB,
> > around 20K tags with no attributes) the performance of the DOMSource
> > is about twice as fast.
> 
> That is surprising... unless you're doing something strange like using
> SAXSource but feeding it from a DOM, so you're paying all the cost of
> first building a DOM and then copying the whole tree into Xalan's data
> model.
> 
> How are you actually invoking the API?
> 
> ------------------------------------------------------------
> Mail was checked for spam by the Freeware Edition of No Spam Today!
> The Freeware Edition is free for personal and non-commercial use. You
> can remove this notice by purchasing a full license! To order or to
> find out more please visit: http://www.no-spam-today.com


Reply via email to