OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xml-dev] DOM or SAX: Sense and Sensibility




From: "Benjamin Franz" <snowhare@nihongo.org>


> On Wed, 7 Nov 2001, PaulT wrote:
>
> >
> > > NOT reading/parsing and rereading/reparsing relatively static
> > > XML documents gives me a huge performance boost.
> >
> > I was under impression that it should usually give
> > about 10-15% boost. Is that 'huge' ?
>
> Using Saxon's native 'DocumentInfo' tree in memory - an at least 10X
> _plus_ performance boost on large documents vs starting from scratch with
> the serialized XML document. I think that _is_ huge.

I also think that 10X _is_ huge, but I think there is some misunderstading.
Let me elaborate.

> > > In fact that is the major reason why I moved from SAX
> > > based XSLT rendering to DOM based rendering for the vast majority of
our
> > > stuff.
> >
> > XSLT rendering is not 'SAX based'. It is 'OM-based'.
>
> I should have been more precise in my language;

Same here.

> 'Live-parsed' vs 'statically cached-OM' then.

So, we have 'document.xml' and tranfromation 'transform.xsl'

1. We load document.xml from XML, we apply the
transformation 'transfrom.xsl'

total time is t1.
- t1.1 is time of parsing XML into OM,
- ttrans is time of transformation

t1.1 + ttrans = t1

2. We load document.xml from binary OM, we apply
the transformation 'transfrom.xsl'

total time is t2.
- t2.1 is time of loading XML from OM,
- ttrans is time of transformation

t2.1 + ttrans = t2

It could be that t1.1 * 10 = t2.1

However, I'm talking about  t2 and t1.
Of course, it is important how big is the
document.xml and how complex is transform.xsl,
but my point is that 'in general', for 'typical transfrom',

the difference between t1 and t2 is 10-15%

I have an impression, that you're comparing t2.1 vs t1.1.
From my point of view that's part of the transfromation
is usually not  a problem. ttrans is usually a 'real'
showstopper ( and I should stress out that ttrans
is also sensitive to chaching of the stylesheet
( to avoid recompilation of the stylesheet ) )

When saying 'typical transfrom' I'm talking about
files of 10-50K

If you have some numbers, I'd be glad to look at them!

Maybe current XSLT engines are now soo fast that
time of parsing XML into OM is a real showstopper,
but last time I checked it was the transfromation itself
that was eating the time. Compilation of stylesheets
was also ... important ... part ...

Rgds.Paul.